Oops ... too much paste ...
John W Moon
-----Original Message-----
From: Al Hospers [mailto:[EMAIL PROTECTED]]
Sent: June 08, 2001 15:57
To: [EMAIL PROTECTED]
Subject: RE: using modules installed in local CGI bin
is this correct?
#!/usr/local/bin/perl
print "Content-Type:text/html\n\n";
print <<EndOfHTML;
<html><head><title>Print Environment</title></head>
<body>
EndOfHTML
print "I am at " . `pwd` . "<br>\n";
foreach $key (sort(keys %ENV)) {
if ($key eq 'PATH')
{
# @paths=split /:/, $ENV{$key}; <-- remove
# if ($#path > 0) <-- remove
@paths=split /:/, $ENV{$key};
if ($#path > 0)
{
print "$key = $ENV{$key}<br>\n";
}
else
{
print "PATHS are:<br><center>\n";
foreach $path (@paths)
{
print "$path<br>";
}
print "</center>";
}
}
else
{
print "$key = $ENV{$key}<br>\n";
}
}
print '<p><b>INC follows:</b><p>';
foreach $b (@INC) {
print '$INC[' . $i++ . "]= $b<br>\n";
}
print "</body></html>";
exit;
I am getting the following command line error:
Array found where operator expected at env.cgi line 13, at end of line
(Missing operator before ?)
syntax error at env.cgi line 13, near ")
@paths"
syntax error at env.cgi line 28, near "else"
Execution of env.cgi aborted due to compilation errors.
thanks,
Al