Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Finding index of an entry in an Array

by dwu (Monk)
on Dec 07, 2007 at 02:57 UTC ( #655570=note: print w/replies, xml ) Need Help??


in reply to Re: Finding index of an entry in an Array
in thread Finding index of an entry in an Array

$index++ until @repo[$index] eq $input or $i > $#repo;
Did you perhaps mean:
$index++ until $repo[$index] eq $input or $index > $#repo;

since you don't declare $i anywhere, and I'd have a hard time not getting that to loop forever when I started comparing zero to $#repo :)

Edit: thanks to IRCperson for spotting $repo[$index]

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://655570]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2017-11-18 03:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (277 votes). Check out past polls.

    Notices?