...
#!/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
...
|