use CGI; use CGI qw/:standard/; use Digest::MD5 qw(md5_hex); my $query = CGI->new(\&hook,$PREF_logfh); my $filename = $query->param('uploadname'); ($filename,$file_ext) = ($filename =~ /(.*)\.(.+)$/); my $upload_filehandle = $query->upload('uploadname'); my $tmpFileName = $query->tmpFileName( $upload_filehandle ); print( $tmpFileName ); #取得MD5 my $ctx = Digest::MD5->new; $ctx->addfile( $upload_filehandle ); print( $ctx->hexdigest );