Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Is map's sub block really being evaluated in list context? wantarray() returns undef..

by BrowserUk (Patriarch)
on Oct 19, 2011 at 16:29 UTC ( [id://932443]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    print map{ print wantarray(); (1,2,3) } 1;;
    Use of uninitialized value in print at (eval 19) line 1, <STDIN> line 
    +11.
    
    1 2 3
    
  2. or download this
    print scalar map{ print wantarray(); (1,2,3) } 1;;
    Use of uninitialized value in print at (eval 20) line 1, <STDIN> line 
    +12.
    
    3
    
  3. or download this
    print do{ print wantarray(); (1,2,3) };;
    Use of uninitialized value in print at (eval 23) line 1, <STDIN> line 
    +15.
    
    1 2 3
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-26 02:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found