... #!/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 "
Attempting to open file: " . $args{'file'} . " from " . $args{root} . "
"; open ( DATA, $args{root}.$args{file} ) or print "Unable to open from this location - $!
"; local($/) = undef; $data = ; close (DATA); print $data; 1 ...