in reply to Re: Opening files problem
in thread Opening files problem
I also have this cgi file:This is the first line of the datafile. This is the second line of the datafile. This is the third line of the datafile. This is the last line of the datafile.
When I run the cgi file, the script does run. It prints an html page in IE and it says "Hello, Booger". I can't figure out why it's not opening the file. They are both in the same directory. In fact they're both in c:\Inetpub\wwwroot\CGI-BIN#!/usr/bin/perl print "Content-type: text/html\n\n"; &print_return_page_top; if (open (FILENAME, "data.txt")) { $line = <FILENAME>; while ($line ne "") { print "$line<BR>"; $line = <FILENAME>; } } else { print "Booger<br>"; } &print_return_page_bottom; ################################## sub print_return_page_top { print <<RETURN_PAGE_TOP; <HTML> <HEAD> <TITLE>This Reads And Prints A File</TITLE> </HEAD> <BODY BGCOLOR="#COCOCO" TEXT="#000000" LINK="#0000FF" VLINK="#9966CC" +ALINK="#FF0000"> <P>Hello, RETURN_PAGE_TOP } ################################### ################################## sub print_return_page_bottom { print <<RETURN_PAGE_BOTTOM; </BODY> </HTML> RETURN_PAGE_BOTTOM } ###################################
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Opening files problem
by Ferret (Scribe) on Jul 30, 2002 at 18:47 UTC | |
Re: Re: Re: Opening files problem
by graff (Chancellor) on Jul 31, 2002 at 02:18 UTC | |
by mojobozo (Monk) on Jul 31, 2002 at 11:27 UTC |