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

Re: Re: Returning lists vs arrays

by ihb (Deacon)
on Jan 20, 2003 at 16:54 UTC ( #228393=note: print w/replies, xml ) Need Help??


in reply to Re: Returning lists vs arrays
in thread Returning lists vs arrays

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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2022-10-05 08:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (21 votes). Check out past polls.

    Notices?