[EMAIL PROTECTED] wrote:
>
> #!/usr/bin/perl -w
> use strict;
> BEGIN{open(STDERR, ">./err.txt")}
> print "Content-Type: text/html\n\n";
> foreach my $key (sort keys %ENV) {
>      print "\$ENV{$key} = $ENV{$key}<br/>\n";
> }
>
> None of my scripts are functioning on my new server.  The BEGIN
> statement doesn't write err.txt But it does function from a
> shell.  I also changed the code thinking it was a  header
> problem.  But it does not function either.
>
> #!/usr/bin/perl -w
> use strict;
> BEGIN{open(STDERR, ">./err.txt")}
> use CGI;
> my$q = CGI::new();
> print $q->header;
> foreach my $key (sort keys %ENV) {
>      print "\$ENV{$key} = $ENV{$key}<br/>\n";
> }
>
> The permissions are set to 0755.  I thought maybe the .pl
> extention wasn't recognized so I changed it to cgi,  No such
> luck. I'm out of my bag of tricks.  My provider isn't
> responding to my emails.  I'm guessing apache isn't configured
> right.

You've committed the cardinal sin of failing to check your 'open'
call. I don't understand why you should want the call in a BEGIN
block anyway, but write this

  open STDERR, '> err.txt' or die $!

and check your Apache log file. It's my guess the cgi-bin directory
is read-only from within your script.

HTH,

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to