Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Constants lists in array slices

by LanX (Sage)
on Jul 20, 2018 at 12:25 UTC ( #1218894=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    X:\>perl -MO=Deparse -e"use constant L=>1,2,3; print @a[L]"
    use constant ('L', 1, 2, 3);
    print @a[1..3];
    -e syntax OK
    
  2. or download this
    D:\>perl -MO=Deparse -e"use constant L=>1,2,3; print @a[L]"
    use constant ('L', 1, 2, 3);
    print @a[L()];
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (1)
As of 2022-08-09 23:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?