in reply to hash problems
May be I have misunderstood the question,
I have made some variations in ur code. Instead of using hashes i have used arrays.
@numbers=(1,2,3,4); @signs=('+','-','*','+'); @thirdarray=(2,3); my @new = map { [$numbers[$_],$signs[$_]]} 0 .. $#numbers; foreach my $i (0..$#new) { print $new[$i+1]->[0],$new[$i+1]->[1]."\n" if (grep{/^$new[$i]->[0]$/} +@thirdarray); }
Cheers.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: hash problems
by Anonymous Monk on Jul 08, 2004 at 11:17 UTC |