Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: grep { } positional number of element

by tybalt89 (Monsignor)
on Oct 23, 2022 at 23:45 UTC ( [id://11147631]=note: print w/replies, xml ) Need Help??


in reply to grep { } positional number of element

In plain old ordinary basic perl (whatever that is) I'd just do:

#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11147614 use warnings; my @myArray = qw(alfa beta gamma); warn "at position $_ there is $myArray[$_]\n" for 0 .. $#myArray;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (8)
As of 2024-04-20 00:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found