Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: hash from sub directly into foreach loop

by Corion (Patriarch)
on Jun 30, 2006 at 08:32 UTC ( [id://558533]=note: print w/replies, xml ) Need Help??


in reply to Re^2: hash from sub directly into foreach loop
in thread hash from sub directly into foreach loop

Please show working code which does what you're trying to do. When I try the following, it doesn't work:

Q:\>perl -MCGI -le "foreach( keys CGI::Vars() ) { print }" Type of arg 1 to keys must be hash (not subroutine entry) at -e line 1 +, near ") ) " Execution of -e aborted due to compilation errors.

When I try the following, which the documentation and davidj suggest, it works (in the sense of not being a syntax error). But that works by returning a hash reference:

Q:\>perl -MCGI -le "foreach( keys %{ CGI::Vars() }) { print }" Q:\>

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-18 04:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found