Here's how I'd approach it:
my @numbers = qw(1 2 2 3 3); my @strings = qw(hello green grass rainbow pretty); my @check = qw(1 2 3 4); my %concat; for (0 .. $#numbers) { $concat{$numbers[$_]} .= $strings[$_]; } for (@check) { print $concat{$_} || "xxxxxxxx", "\n"; }
In reply to Re: arrays and strings
by revdiablo
in thread arrays and strings
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |