in reply to Re: boolean IN(); function in perl like
in thread boolean IN(); function in perl like
If you are wondering why first isn't enough, imagine...if ( any { $_ eq $foo } @list ) { }
Of course, this assumes you only need to check once and once only. If you want to check many times, build the hash index and do it that way.if ( first { ! defined $_ } @list ) { # Does not get called if it matches } if ( any { ! defined $_ } @list ) { # Does get called it if matches }
Edit by castaway - swapped lotsa br tags for code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: boolean IN(); function in perl like
by Errto (Vicar) on Jan 17, 2005 at 04:31 UTC |