CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
print a file

 



MTO
Deleted

Feb 8, 2001, 8:30 PM

Post #1 of 3 (140 views)
print a file Can't Post

How can you tell the program to print a file?
For example, at one point in my cgi I want it to print a file such as:
"../includes/file_1.txt".
And the contents of file_1 will be part of the html printed out.

Thanks. Smile



muinatit
Deleted

Feb 9, 2001, 2:54 PM

Post #2 of 3 (127 views)
Re: print a file [In reply to] Can't Post


Code
open (INF, "../includes/file_1.txt") || die $!; 
print $_ while (<INF>);
close (INF);

muinatit
muinatit@hotpop.com


MTO
Deleted

Feb 9, 2001, 5:43 PM

Post #3 of 3 (125 views)
Re: print a file [In reply to] Can't Post

Thanks! Smile


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives