Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Re: Returning lists vs arraysby ihb (Deacon) |
on Jan 20, 2003 at 16:54 UTC ( [id://228393]=note: print w/replies, xml ) | Need Help?? |
Outside your subroutine, the distinction doesn't matter.
It does, depending on context. See Context aware functions - best practices? for an example of this. It will all look like arrays(Assuming list context.) Make that "lists" instead. A bunch of values are returned, and as you say yourself, that's a list. If you really want to return a list but the whole list is stored in an array you can do return @stuff[0..$#stuff]; ihb
In Section
Seekers of Perl Wisdom
|
|