Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
In the above code can i test for the value referred to be $index to be present or not in the array @index_corr_file with in the if condition only. I mean is there a one line answer to the above snippet. Thanks in advance Sidforeach (@index_corr_file) { if ($index == $_) { $is_present_flag = 1; last; } } if ($is_present_flag) { ##do something }
2005-02-16 Janitored by Arunbear - added code tags, as per Monastery guidelines
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Regex problem
by edan (Curate) on Feb 16, 2005 at 11:57 UTC | |
Re: Regex problem
by tphyahoo (Vicar) on Feb 16, 2005 at 11:56 UTC | |
Re: Regex problem
by chb (Deacon) on Feb 16, 2005 at 12:01 UTC | |
Re: Regex problem
by sh1tn (Priest) on Feb 16, 2005 at 15:16 UTC | |
Re: Regex problem
by Anonymous Monk on Feb 16, 2005 at 12:01 UTC | |
by edan (Curate) on Feb 16, 2005 at 12:14 UTC | |
by prasadbabu (Prior) on Feb 16, 2005 at 12:06 UTC | |
by edan (Curate) on Feb 16, 2005 at 12:25 UTC |