Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Use of wantarray Considered Harmful (consider)

by tye (Sage)
on Dec 12, 2008 at 22:41 UTC ( [id://730064]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        return @x;
        # same as
    ...
        return( ..., $y );
        # same as
        return wantarray ? ( ..., $y ) : $y;
    
  2. or download this
        croak( "This only makes sense in a list context!" )
            if  ! wantarray;
        # ...
        return @list;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-04-23 09:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found