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

Re: Re: Re: appending arrays

by Not_a_Number (Prior)
on Nov 19, 2003 at 20:57 UTC ( [id://308407]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: appending arrays
in thread appending arrays

That will get the data off the end of @array2, not the beginning.

Err... Isn't that what the OP wanted? It works fine for me with the OP's data. OK, it destroys @array2, as Abigail-II pointed out. Just for fun, here's a solution that destroys both of the original arrays:

die "Arrays of different lengths" unless @array1 == @array2; my @array3 = map { shift ( @array1 ) . pop ( @array2 ) } @array1;

dave

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://308407]
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-24 18:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found