$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.

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.