Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: How do I find the array element directly preceeding a 'match'?

by ton (Friar)
on Apr 05, 2001 at 03:39 UTC ( [id://69945]=note: print w/replies, xml ) Need Help??


in reply to How do I find the array element directly preceeding a 'match'?

Or you could just use a for loop, and eliminate the need for multiple assignments:
for ($i=0; $i<scalar(@array); ++$i) { last if (matches($array[$i])); } $found = $array[$i-1] if ($i);
  • Comment on Re: How do I find the array element directly preceeding a 'match'?
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://69945]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2024-04-18 02:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found