Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: printing every 2nd entry in a list backwards

by tobyink (Canon)
on May 19, 2017 at 15:47 UTC ( [id://1190641]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use v5.16;
    use List::Util qw/pairmap/; # this is in core if you have a recent Per
    +l
    ...
    my @list = qw( 1 22 3 -4 5 666 7 );
    
    say pairmap { "$b " } reverse @list;
    
  2. or download this
    use v5.16;
    use List::Util qw/pairmap/;
    ...
    # grepstate -  3 wallclock secs ( 3.12 usr +  0.00 sys =  3.12 CPU) @ 
    +33.33/s (n=104)
    ok 8 - no (unexpected) warnings (via done_testing)
    1..8
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-23 15:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found