Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: in_array and skipping foreach

by RazorbladeBidet (Friar)
on Apr 13, 2005 at 14:31 UTC ( #447412=note: print w/replies, xml ) Need Help??


in reply to in_array and skipping foreach

There's no specific function for finding a value in an array. You make your own (or use a module). Yours seems fine.

For your second question, see next - specifically "next LABEL"
--------------
"But what of all those sweet words you spoke in private?"
"Oh that's just what we call pillow talk, baby, that's all."

Replies are listed 'Best First'.
Re^2: in_array and skipping foreach
by VSarkiss (Monsignor) on Apr 13, 2005 at 14:34 UTC
      Isn't it faster to create a lookuptable next to your array? The value in the array will be the key in the lookup table (hash) with the value 0 or 1.

      "We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.
      Ah yes, I spoke to soon. Shouldn't write answers when distracted ;)
      --------------
      "But what of all those sweet words you spoke in private?"
      "Oh that's just what we call pillow talk, baby, that's all."

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2023-03-28 06:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (66 votes). Check out past polls.

    Notices?