Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: iterating through array and saving matches to new array

by choroba (Cardinal)
on Apr 15, 2018 at 21:46 UTC ( [id://1212952]=note: print w/replies, xml ) Need Help??


in reply to Re: iterating through array and saving matches to new array
in thread iterating through array and saving matches to new array

&& imposes scalar boolean context on the first argument. Therefore, the grep on line 4 iterates over @d only provided @b and @c aren't empty. To iterate over several arrays, use comma:
my @newb = grep $_ > 850, @b, @c, @d;

It's also a good idea to test the code before posting here ;-)

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2024-04-25 08:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found