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
|
---|
In Section
Seekers of Perl Wisdom