----- Original Message -----
From: "Mike Kalinovich" <[EMAIL PROTECTED]>
To: "Perl-Win32-Users" <[EMAIL PROTECTED]>
Sent: Friday, October 18, 2002 11:10 AM
Subject: CGI on iis5 question
> Hello,
> Very simple script, opens a file, reads it into an array, and then it
> "should" display it to the browser. But it's not, and I'm at a loss why.
> It works command line fine. But not via the web. Using ActiveState build
> 633 (perl -v = v5.6.1)
>
> IIS5 entries are:
> .cgi d:\perl\bin\perl.exe %s %s
> .pl d:\perl\bin\perl.exe %s %s
>
> What am I missing ?
> No errors are reported via the web. Any tips would be good.
>
> Mike Kalinovich
>
> ******* insert code *******
>
> #!/usr/bin/perl
>
> print "Content-type:text/html\n\n";
>
> open(inf,"tester.pl") or die;
> @ary = <inf>;
> print "file is opened and dumped into array\n";
>
> foreach $line (@ary) {
> chomp $line;
> print "$line\n";
> }
>
> close(inf)
>
I think you'll find that the script dies at the 'open' call, because it
won't find tester.pl. Good idea to use 'die "$!";' so that you get at least
some output when the 'open' fails.
It will work from the command line if 'tester.pl' and the script are in the
same directory. But it won't work from IIS because IIS has some perverse
notion of where the current working directory is. (Should work if you
specify full path to 'tester.pl'.)
Cheers,
Rob
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs