coldy has asked for the wisdom of the Perl Monks concerning the following question:
Id like to create a new array, @c, based on a set of rules based on all the possible matchings of the elements in @a and @b ;@a= [a,b,c,b,b,c,a,a] @b= [a,a,b,c,c,a,b,c]
for example, if $a[]=a and $b[]=a then $c[]=x.@a=aaabbbccc @b=abcabcabc @c=xyzrstmno
Im guessing the use of map and a hash to assign the rules but cant work out the specifics.
Thanks in advance for any ideas.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: recode 2 strings into 1
by GrandFather (Saint) on Feb 27, 2009 at 00:30 UTC | |
|
Re: recode 2 strings into 1
by olus (Curate) on Feb 26, 2009 at 23:57 UTC | |
|
Re: recode 2 strings into 1
by bichonfrise74 (Vicar) on Feb 27, 2009 at 00:34 UTC |