Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: grep { } positional number of element

by jo37 (Deacon)
on Oct 23, 2022 at 21:52 UTC ( [id://11147619] : note . print w/replies, xml ) Need Help??


in reply to grep { } positional number of element

Or, if you dislike loops:

use v5.16; use List::MoreUtils 'reduce_u'; my @array = qw(alpha beta gamma); reduce_u {say "at position $_ there is $b"} @array;

Greetings,
-jo

$gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$