Or how about this?
use File::Copy;
print "<html>\n<pre>\n";
copy "myfile.txt", \*STDOUT;
print "</pre>\n</html>\n";
- B
> Hello!
>
> An example would look like this:
>
> #!/usr/bin/perl -w
> use strict;
> use CGI qw(:standard);
>
> my $file_loc = "bla";
> my @file;
>
> if (open(FILE, $file_loc)) {
> @file = <FILE>;
> print header;
> print start_html();
> print "<pre>@file</pre>";
> close (FILE);
> print end_html();
> } else {
> print header;
> print start_html();
> print "<h1>Cant open file: $file_loc</h1>";
> print end_html();
> }
>
> Hope it works ;)
>
> Luka
>
>>
>> Od: "Sun, Jian" <[EMAIL PROTECTED]>
>> Datum: 2004/08/10 Tor PM 10:52:05 GMT+02:00
>> Za: <[EMAIL PROTECTED]>
>> Cc: <[EMAIL PROTECTED]>
>> Zadeva: How to display a Text file using web browser under CGI
>>
>> Dear all;
>> Could anybody help me to figure out How to display a Text file using the
>> web browser in a CGI program?
>>
>> Thanks in advance
>> Jian
>>
>> --
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>>
>>
>>
>
> =================================
> Mirko tipka na radirko.
> http://www.worldofspectrum.org/
> =================================
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>