Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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?
[soonix]: can confirm: in the comment form, "preview" activates "create" button, in the new post form it doesn't.

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2017-12-15 06:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (418 votes). Check out past polls.

    Notices?