Be careful -- there are a ton of cgi scripts out there that are no good (and an
entire book by Elizabeth Castro, "Perl and CGI for the World Wide Web).

If you're using perl for cgi, it's pretty much mandatory from a practical standpoint
to use the fantastic CGI module that ships with your perl. It is easy to use and
handles all of the CGI protocol for you automatically. Use it and you'll be happy
and more productive. Plus you'll learn a great deal from it. I know I did, and still
do.  

perldoc CGI will tell you how to use the module, and you'll find that you'll be able
to open your text file and print it out to a browser with ease. Most servers will
default to a type of "text/plain" or "text/html", so you should be able to do
something like this:

##############################
use CGI qw(:standard);
use diagnostics; # great for learning to troubleshoot perl !
use strict;
open (FILE, "Test.txt");

my @data=(<FILE>);

#print "@data";
print header('File Output'),
        start_html,
        pre(@data),
        end_html;

#############################

Will include preformatted text in your browser.

Hope this helps,
Matt


--- perl <[EMAIL PROTECTED]> wrote:
>  
> 
> Hi ,,,
> this my first time i write to you :)
> i have the uncluder script
> $file = $ENV{'QUERY_STRING'};
> print "Content-type: text/html\n\n";
> if($file eq "") {
> print "document.writeln('
> Includer Error: No File Specified.
> ');\n"; print "document.writeln('Script by SmartCGIs.com 
> <%5C%22http://www.smartcgis.com%5C%22>
> 
> ');\n";
> exit;
> }
> 
> open(DATA,"$file") || print "document.writeln('
> Includer Error: Could not open $file ($!).
> Script by SmartCGIs.com <%5C%22http://www.smartcgis.com%5C%22>
> 
> ');";
> @filecontent = ;
> close(DATA);
> foreach $line(@filecontent) {
> chomp($line);
> $line =~ s/\'/\\\'/g;
> print "document.writeln('$line');\n";
> }
> when i add
> 
> its not work any help
> or if there any whay to include a text file without useing SSI or IFrame
> Thanks
> :)
> 
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to