chrism01 has asked for the wisdom of the Perl Monks concerning the following question:
Huh???@arr2 =('a', 'b'); @arr1 = ('a'); for $var1 (@arr2) { if( grep($var1, @arr1) ) { print "match $var1\n"; } } output: match a match b
surely only the 'a' should match?
Cheers
Chris
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Weird grep behaviour
by shmem (Chancellor) on Oct 17, 2007 at 06:16 UTC | |
|
Re: Weird grep behaviour
by Krambambuli (Curate) on Oct 17, 2007 at 08:08 UTC | |
|
Re: Weird grep behaviour
by moritz (Cardinal) on Oct 17, 2007 at 05:56 UTC | |
by shmem (Chancellor) on Oct 17, 2007 at 06:08 UTC | |
by naikonta (Curate) on Oct 17, 2007 at 07:36 UTC | |
|
Re: Weird grep behaviour
by chrism01 (Friar) on Oct 17, 2007 at 06:55 UTC | |
by snoopy (Curate) on Oct 17, 2007 at 07:57 UTC | |
by naikonta (Curate) on Oct 17, 2007 at 07:44 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |