Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: appending arrays

by Abigail-II (Bishop)
on Nov 19, 2003 at 16:52 UTC ( [id://308338]=note: print w/replies, xml ) Need Help??


in reply to appending arrays

Homework? What have you tried yourself?

#!/usr/bin/perl use strict; use warnings; sub zip (\@\@) { map {"${$_[0]}[$_]${$_[1]}[$#{$_[0]}-$_]"} 0 .. $#{$_ [0]} } my @array1 = qw /lots of nice words/; my @array2 = qw /red clothes are fun/; my @array3 = zip @array1, @array2; print "@array3\n"; __END__ lotsfun ofare niceclothes wordsred

Abigail

Replies are listed 'Best First'.
Re: Re: appending arrays
by ysth (Canon) on Nov 20, 2003 at 00:40 UTC
    See rotate for some ways of getting rid of those unsightly \w characters in zip.

    (Update: meant \d, not \w, not much you can do about _ without ''=~ tricks)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-16 15:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found