[Xitami] CGI Scripting

Patrick L. Olson xitami@lists.xitami.org
Sat, 27 Oct 2001 06:07:43 -0600


David Lambert wrote:
> 
> I have a Perl script in webroot/cgi-bin, which reads a text file in and
> outputs it in HTML format to the requesting browser (see smaple script
> below). Well, that's what it's supposed to do.

David check the cgierr.log in xitami root it should have
something also
#! perl should be fine in windows if perl is set in your path
and always

use strict;
this will point you to most errors

# Define Variables? no your not use my()
my ($Script, $lines, @text, $line);

you may also want to 
use CGI::Carp "fatalsToBrowser"; #shows error in browser

# Read Name of Script...

        $Script = $ENV{'SCRIPT_NAME'};
		
       if ($Script eq "") {$Script = "default.txt"};
       
	not sure if $Script here is getting set it may be empty
and empty and "" are differant set $Script ="" 
before the $ENV{'SCRIPT_NAME'}

# Open Script....Always die with $! to let you know
        open(TXT, "<".$Script)|| die "Can't Open ::$Script:: $!\n";
        @text=<TXT>;
        close(TXT);

read up on the doc's good stuff in there:)

hope you get is going

Pat...