Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: List context or not?

by yakko (Friar)
on Mar 13, 2001 at 00:06 UTC ( #63934=note: print w/replies, xml ) Need Help??


in reply to List context or not?

Since foo() returns a list, why not assign it to a list:
my @bar=foo(); print "@bar\n";
To get the number of keys returned by foo(), it'd be:
my $baz=scalar(@bar);
(Update: the "wantarray" answers are probably better, I'm a young grasshopper learning, blah blah blah. :o)

--
Me spell chucker work grate. Need grandma chicken.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://63934]
help
Chatterbox?
[MidLifeXis]: Ahh well, time to get back to it, so there isn't a reason to take that choice out of my hands :-)
[LanX]: Inner emigration

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2017-03-23 12:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (286 votes). Check out past polls.