in reply to Re: Array location?
in thread Array location?

You will get stuck in an endless loop with that one if the match is not in the array. I'm sure you meant:

my $idx=0; $idx++ while $array[$idx] ne 'entry' && $idx < $#array; die 'Entry not found' if $idx == $#array and $array[-1] ne 'entry';

Replies are listed 'Best First'.
Re: Re: Re: Array location?
by BrowserUk (Patriarch) on Jul 08, 2003 at 21:28 UTC

    cees++ Updated, thanks.

    Yes! I'm sure that's what I meant :)


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller