Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by dwu (Monk)
on Dec 07, 2007 at 02:57 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://655570]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2024-04-23 13:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found