#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
my $EX_DIR = "/media/EXTERNAL";
sub displayHardDriveFiles () {
opendir( DIR, $EX_DIR ) || die "
Cannot open $EX_DIR: $!
\n";
print <
Files on this harddrive |
HTML
foreach my $d (sort readdir(DIR)) {
print "$d |
\n";
}
print <
HTML
}
print header;
print start_html ("Welcome");
displayHardDriveFiles();
print end_html;