Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Problematic UploadFile() method in CGI.pm

by ioannis (Prior)
on May 20, 2006 at 20:08 UTC ( #550728=note: print w/replies, xml ) Need Help??


in reply to Problematic UploadFile() method in CGI.pm

You need add a parenthesis to capture the hash reference, otherwise you will keep getting undef:

print h2('File MIME type'), (uploadInfo($file))->{'Content-Type'};

  • Comment on Re: Problematic UploadFile() method in CGI.pm

Replies are listed 'Best First'.
Re^2: Problematic UploadFile() method in CGI.pm
by Errto (Vicar) on May 21, 2006 at 17:02 UTC
    I don't believe that's correct. See this small example:
    my $hash = { a => 'b' }; sub foo { print $_[0], "\n"; return $hash; } print foo('abcd')->{a};
    No parens required to use the arrow notation with a subroutine return value.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://550728]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2016-09-29 01:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (544 votes). Check out past polls.