Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
foreach my $element(@array1) { #I want to check if the value exists in @array2 #Any smart ways to deal with this? #This looks bad... foreach my $another_element(@array2) { if ($element eq $another_element) { print "Hey...\n"; } } }
Edit kudra, 2002-05-31 Changed title
Thanks!:)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: any smart ideas??:)
by the_0ne (Pilgrim) on May 30, 2002 at 14:47 UTC | |
|
Re: any smart ideas??:)
by VSarkiss (Monsignor) on May 30, 2002 at 14:56 UTC | |
|
Re: any smart ideas??:)
by vladb (Vicar) on May 30, 2002 at 14:47 UTC | |
|
Re: any smart ideas??:)
by DamnDirtyApe (Curate) on May 30, 2002 at 15:17 UTC | |
|
Re: any smart ideas??:)
by andreychek (Parson) on May 30, 2002 at 15:32 UTC | |
|
Re: any smart ideas??:)
by Bilbo (Pilgrim) on May 30, 2002 at 14:58 UTC | |
|
Re: any smart ideas??:)
by dsheroh (Monsignor) on May 30, 2002 at 15:00 UTC | |
|
Re: any smart ideas??:)
by marvell (Pilgrim) on May 30, 2002 at 15:14 UTC |