Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: printing every 2nd entry in a list backwards

by KurtZ (Pilgrim)
on May 19, 2017 at 12:01 UTC ( #1190601=note: print w/replies, xml ) Need Help??


in reply to printing every 2nd entry in a list backwards

TIMTOWTDI

You could use 2 pop in loop to extract the last 2 elements of an array.

Similarly splice

You can also count an index backwards.

  • Comment on Re: printing every 2nd entry in a list backwards

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1190601]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2018-06-23 08:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (125 votes). Check out past polls.

    Notices?