>     if ($#path > 0)
>     @paths=split /:/, $ENV{$key};

Should be
     if ($#path > 0) {
         @paths=split /:/, $ENV{$key};
     }

Your content type should be (space after the colon)

    print "Content-Type: text/html\n\n";

--- Al Hospers <[EMAIL PROTECTED]> wrote:
> 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
> 
> 


=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to