Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Trouble getting size of list returned from sub

by kcott (Abbot)
on Nov 26, 2012 at 09:07 UTC ( #1005597=note: print w/ replies, xml ) Need Help??


in reply to Trouble getting size of list returned from sub

G'day wanna_code_perl,

You can achieve this by wrapping bad() in @{[...]}.

$ perl -Mstrict -Mwarnings -E ' sub bad { qw/foo bar baz/ } say scalar bad(); say scalar @{[bad()]}; ' baz 3

-- Ken


Comment on Re: Trouble getting size of list returned from sub
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-10-25 13:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (143 votes), past polls