Not_a_Number has asked for the wisdom of the Perl Monks concerning the following question:
Please don't -- me before reading on. I know this is a FAQ, and I know the answer(s) in the FAQ. I also know it's in the Q&A section here (although some of the answers there are rather strange...).
It's just that a couple of times recently I've come across this sort of thing:
my @array = qw ( a b c d x ); my $sought = 'a'; print 'Found!' if index ("@array", $sought) > -1;
So, my question: is there anything wrong with this? (if there is, I'm quite happy to forget I ever saw it :-).
TIA
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is X in my array?
by dws (Chancellor) on Jun 17, 2003 at 18:20 UTC | |
by Not_a_Number (Prior) on Jun 17, 2003 at 18:33 UTC | |
|
Re: Is X in my array?
by Zaxo (Archbishop) on Jun 17, 2003 at 18:25 UTC | |
|
Re: Is X in my array?
by antirice (Priest) on Jun 17, 2003 at 18:31 UTC | |
by Not_a_Number (Prior) on Jun 17, 2003 at 19:00 UTC | |
by antirice (Priest) on Jun 17, 2003 at 19:22 UTC | |
|
Re: Is X in my array?
by sauoq (Abbot) on Jun 18, 2003 at 00:07 UTC | |
|
Re: Is X in my array?
by sgifford (Prior) on Jun 17, 2003 at 18:46 UTC | |
|
Re: Is X in my array?
by Aristotle (Chancellor) on Jun 20, 2003 at 19:13 UTC |