Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Is there a nicer way to find the index number matching a string in an array rather than doing foreach and going through every line?
I know grep can be used to find is the string is there, but it does not give the index number.
Thank you.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: finding index number in an array
by tlm (Prior) on May 27, 2005 at 22:12 UTC | |
|
Re: finding index number in an array
by mrborisguy (Hermit) on May 27, 2005 at 22:12 UTC | |
|
Re: finding index number in an array
by BrowserUk (Patriarch) on May 27, 2005 at 22:13 UTC | |
|
Re: finding index number in an array
by Transient (Hermit) on May 27, 2005 at 22:16 UTC | |
by fishbot_v2 (Chaplain) on May 27, 2005 at 22:54 UTC | |
|
Re: finding index number in an array
by Anonymous Monk on May 27, 2005 at 22:44 UTC | |
|
Re: finding index number in an array
by Anonymous Monk on May 27, 2005 at 23:14 UTC | |
|
Re: finding index number in an array
by Ninthwave (Chaplain) on May 28, 2005 at 00:41 UTC | |
|
Re: finding index number in an array
by salva (Canon) on May 28, 2005 at 12:40 UTC |