in reply to use CGI vs use CGI qw(:standard)

As an aside, $file =~ /.*\\(.*\.(gif|jpg))/ is a bad way to get the filename. Unless this will be used on an intranet where only Windows operating systems will be able to access the script, your script will not do what you want if someone on a *nux or mac machine accesses the script. You should use one of the file0related modules to grab the name instead:

use File::Basename; my $file = $q->param('upfile') || ''; $file = basename($file);

Replies are listed 'Best First'.
Re: Re: use CGI vs use CGI qw(:standard)
by kiat (Vicar) on Apr 20, 2004 at 00:34 UTC
    Thanks, I saw that in jeffa's code too. Will change it right away :)