title: Why does Perl's DBI complain about "failed: ERROR OCIEnvNlsCreate" when I try to connect to Oracle 11g?
body: <p>I am getting the following error connecting to an Oracle 11g database using a simple Perl script:</p>
  
  <pre><code> failed: ERROR OCIEnvNlsCreate. Check ORACLE_HOME (Linux) env var  or PATH (Windows) and or NLS settings, permissions, etc. at
  </code></pre>
  
  <p>The script is as follows:</p>
  
  <pre><code>#!/usr/local/bin/perl
  
  use strict;
  use DBI;
  
  if ($#ARGV &lt; 3) {
  print "Usage: perl testDbAccess.pl dataBaseUser dataBasePassword SID dataBasePort\n";
  exit 0;
  }
  my ($user, $pwd, $sid, $port) = @ARGV;
  
  my $host = `hostname`;
  my $dbh;
  my $sth;
  my $dbname = "dbi:Oracle:HOST=$host;SID=$sid;PORT=$port";
  
  openDbConnection();
  closeDbConnection();
  
  sub openDbConnection() {
          $dbh = DBI-&gt;connect ($dbname, $user ,$pwd , { RaiseError =&gt; 1}) || die "Database connection not made: $DBI::errstr";
  }
  
  sub closeDbConnection() {
          #$sth-&gt;finish();
          $dbh-&gt;disconnect();
  }
  </code></pre>
  
  <p>Anyone seen this problem before?</p>