Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: appending arrays

by Art_XIV (Hermit)
on Nov 19, 2003 at 18:20 UTC ( [id://308373]=note: print w/replies, xml ) Need Help??


in reply to appending arrays

The nth way of doing it:

my @array1 = ('lots', 'of', 'nice', 'words'); my @array2 = ('red','clothes', 'are', 'fun'); my @array3; if (scalar @array1 == scalar @array2) { $array3[$_] = $array1[$_] . $array2[-($_ + 1)] for (0 .. $#array1); } print "@array3\n";
Hanlon's Razor - "Never attribute to malice that which can be adequately explained by stupidity"

Log In?
Username:
Password:

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

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

    No recent polls found