Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: iterating through array and saving matches to new array

by learnedbyerror (Monk)
on Apr 15, 2018 at 18:18 UTC ( [id://1212939]=note: print w/replies, xml ) Need Help??


in reply to iterating through array and saving matches to new array

With the replacement of our with my, your method, as a generalized method is fine.

poj's use of grep is preferred when you have a simple criterion, such as your >850, as it will be faster than the generalized method.

Replies are listed 'Best First'.
Re^2: iterating through array and saving matches to new array
by Marshall (Canon) on Apr 16, 2018 at 01:59 UTC
    I am not sure about that!

    That idea of "faster" is true in Python's equivalent, but I'm not at all sure about that in Perl.

    In Perl, the foreach loop should run at about the same speed.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-25 17:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found