Hi monks, I am having problems just simply printing the contents of a file to screen that a user has submitted on my CGI. Can anyone see where i'm going wrong?
#! /usr/bin/perl -w
use CGI qw(: standard);
my $query = new CGI;
print STDOUT $query->header();
print STDOUT $query->start_html -title=> "CGI",
-BGCOLOR=>"#CCDDFF");
my $file_contents = $query->param('file');
my $image = $query->param('image');
$file_contents =~ m/^.*(\\|\/)(.*)/;
my $name = $2;
$image =~ m/^.*(\\|\/) (.*)/;
my $image_name = $2;
while (<$file_contents>) {
$data = do { local $/ = undef; <$file_contents> };
}
print STDOUT "$data<p>";