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)