in reply to IE vs. Firefox : Can't use an undefined value as a HASH reference error

Don't know if I have enough information to nail down your problem, but I can offer a known difference between the two browsers. If you have a form and the submit button has a name, IE won't send the button name if the user just hits 'Return' rather than clicking the button. Firefox will. So maybe the button param isn't getting passed and that's tripping up your 'uploadInfo'?

Can you post the uploadInfo code?

  • Comment on Re: IE vs. Firefox : Can't use an undefined value as a HASH reference error

Replies are listed 'Best First'.
Re^2: IE vs. Firefox : Can't use an undefined value as a HASH reference error
by hmbscully (Scribe) on Feb 24, 2005 at 17:22 UTC
    Here's the subroutine for storing the file:
    #stores uploaded files sub storeFiles{ my($filename, $directory, $mime) = @_; #name subroutine variables my $data; my $mime = uploadInfo($filename)->{'Content-Type'}; open (STORAGE, ">$directory/$filename") or die "Error: $directory/ +$filename: $!\n"; if($mime !~ /text/){ binmode ($filename); binmode (STORAGE); } while( read($filename, $data, 1024) ){ print STORAGE $data;} close STORAGE; }
    I'm using the following subroutine to get the filename from the form:
    sub Get_File_Name{ if($ENV{HTTP_USER_AGENT} =~ /win/i){ fileparse_set_fstype("MSWin32"); #changed from MSDOS to try a +nd fix the A:\ problem } elsif($ENV{HTTP_USER_AGENT} =~ /mac/i) { fileparse_set_fstype("MacOS"); } my $full_name = shift; $full_name = basename($full_name); $full_name =~ s!\s!\_!g; # Replace whitespace with _ return($full_name); }
    As for the submit button. It just has a generic name of 'submit' which is not used by the script in any way to identify anything.