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 poj (Abbot)
on Apr 15, 2018 at 06:40 UTC ( [id://1212908]=note: print w/replies, xml ) Need Help??


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

Take a look at grep

#!/usr/bin/perl use strict; use Data::Dump 'pp'; my @a = 1..1000; my @newa = grep( $_>850,@a ); pp \@newa;
poj

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-19 03:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found