Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

S_Shrum's scratchpad

by S_Shrum (Pilgrim)
on Jun 04, 2004 at 03:30 UTC ( [id://360658] : scratchpad . print w/replies, xml ) Need Help??

... #!/usr/local/bin/perl -w BEGIN { print "Content-type: text/html\n\n"; use CGI::Carp qw(carpout); carpout(STDOUT); carpout(\*LOGGY) if open(LOGGY,'>>'.__FILE__.'.err.log'); } use strict; use CGI; my ($input, %args, $data); # get the command line arguments and convert the input variables into +hash values if (@ARGV) { $input = new CGI ( join "&" => @ARGV ); } else { $input += new CGI; } %args = ( $input->Vars ); #attempt to open the file directly print "<P>Attempting to open file: " . $args{'file'} . " from " . $arg +s{root} . "</p>"; open ( DATA, $args{root}.$args{file} ) or print "<P>Unable to open fr +om this location - $!</P>"; local($/) = undef; $data = <DATA>; close (DATA); print $data; 1 ...