Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: qw and $vars or @vars

by g0n (Priest)
on Jan 26, 2006 at 11:52 UTC ( [id://525699]=note: print w/replies, xml ) Need Help??


in reply to qw and $vars or @vars

From your description of your problem, you want to pass your sub an array, made up of two arrays joined together?

The first line of your example should work. Try this:

my @array1 = qw (one two three); my @array2 = qw (four five six); doprint(@array1,@array2); sub doprint { for (@_) { print "$_\n"; } }

Result:

one two three four five six

--------------------------------------------------------------

"If there is such a phenomenon as absolute evil, it consists in treating another human being as a thing."

John Brunner, "The Shockwave Rider".

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-23 05:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found