timtowtdi has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl
use strict;
print "Content-type: text/plain\n\n";
open (INFILE, '<', 'textfile.txt');
while (<INFILE>)
{
print "$_\n";
}
close (INFILE);
The trouble is: I don't get an error-message, but I also don't see the contents of textfile.txt. If I try to print other stuff, for example: I add the line: print "Hello\n"; under the line where I close INFILE, it will return the string Hello in my browser.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't open file using Perl as CGI
by pc88mxer (Vicar) on May 19, 2008 at 21:46 UTC | |
by timtowtdi (Sexton) on May 19, 2008 at 22:03 UTC | |
|
Re: Can't open file using Perl as CGI
by roboticus (Chancellor) on May 19, 2008 at 21:45 UTC | |
by JennieInMI (Acolyte) on Dec 27, 2012 at 02:14 UTC | |
|
Re: Can't open file using Perl as CGI
by kyle (Abbot) on May 19, 2008 at 21:48 UTC | |
|
Re: Can't open file using Perl as CGI
by jonnyfolk (Vicar) on May 20, 2008 at 06:56 UTC | |
by Anonymous Monk on May 20, 2008 at 09:14 UTC |