Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Constants lists in array slices

by kcott (Archbishop)
on Jul 20, 2018 at 13:03 UTC ( #1218901=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -v | head -2 | tail -1
    This is perl 5, version 18, subversion 2 (v5.18.2) built for x86_64-li
    +nux-thread-multi
    $ alias perle
    alias perle='perl -Mstrict -Mwarnings -Mautodie=:all -E'
    
  2. or download this
    $ perle 'use constant X => (1,3); my @y = "a".."z"; say for @y[X]'
    Scalar value @y[X] better written as $y[X] at -e line 1.
    ...
    $ perle 'use constant X => (1,3); my @y = "a".."z"; say for @y[X()]'
    b
    d
    
  3. or download this
    $ perle 'use constant X => 1,3; my @y = "a".."z"; say for @y[(X)]'
    b
    d
    

Log In?
Username:
Password:

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

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

    No recent polls found

    Notices?