Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Arrays and Scalar Parameters

by IraTarball (Monk)
on Aug 20, 2001 at 22:51 UTC ( [id://106309]=note: print w/replies, xml ) Need Help??


in reply to Arrays and Scalar Parameters

I believe that the problem here, as alluded to in Sifmole's post, is that the values are all being returned as a single list. It might be safest to use references as Sifmole says, but for something like what you have here you can get away with just changing the order of the return data.
use strict; use warnings; sub getStuff { return 6, qw(one two three four five six) } my ($thing, @list) = getStuff(); print "my thing is $thing\n"; print "my list is @list\n";
This prints out:
$ perl list.pl my thing is 6 my list is one two three four five six

Hope this helps,
Ira,

"So... What do all these little arrows mean?"
~unknown

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-03-29 12:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found