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};
    if ($#path > 0)
    @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


Reply via email to