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:\>
|
|---|