- or download this
my $path-info = $ENV{PATH_INFO}
my $path = "/home/usrs/rjoseph/images";
$path-info =~ s/^[^/]// # strip of preceeding noise
$path-info =~ s#[^/\w\.]//g # strip out any non-word dot chars
- or download this
my $file_path = "$path/$path-info";
if ( -s $file_path ) {
open(FILE, $file_path) or die ...
- or download this
foreach my $file ( @image_list ) {
$file =~ s#$path##; # remove the physical path part
...
$file_name = s/\.\w+$//; # strip off extension
print "<a href=\"http://mysite.com/cgi-bin/get-image/$file">Image: $
+file_name</a>";
}