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

I would compare how you get $File_Name and how you get $filename. If you're just passing it into the subroutine, that means you changed somethign else. Also, how are you calling storeFiles()?

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

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

Replies are listed 'Best First'.
Re^8: IE vs. Firefox : Can't use an undefined value as a HASH reference error
by hmbscully (Scribe) on Feb 24, 2005 at 20:29 UTC
    $File_Name = Get_File_Name(param('filename')); sub Get_File_Name{ if($ENV{HTTP_USER_AGENT} =~ /win/i){ fileparse_set_fstype("MSDOS"); } 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); } storeFiles($File_Name, $Directory); sub storeFiles{ my($filename, $directory) = @_; #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; }
    So I'm getting $File_Name using calling $Get_File_Name with param() and getting $filename in the subroutine with my($filename, $directory) = @_; #name subroutine variables. I will readily admit I don't understand the @_ very much. I printed both variables to see what they were and they both had the same value (a filename: test_file.doc), which is what I'd expect.