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

Re: through an array in reverse

by blue_cowdawg (Monsignor)
on Aug 06, 2012 at 15:56 UTC ( #985761=note: print w/ replies, xml ) Need Help??


in reply to through an array in reverse

Backwards in an array? Simple...

use strict; my @j=qw/ a b c d e f g /; while ( my $i=pop @j){ printf "%s\n",$i; }


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg


Comment on Re: through an array in reverse
Download Code
Re^2: through an array in reverse
by Athanasius (Abbot) on Aug 06, 2012 at 16:38 UTC

    OK, but let’s not forget the reverse function:

    #! perl use strict; use warnings; my @j = ('a' .. 'g'); print join("\n", reverse @j);

    ;-)

    Athanasius <°(((><contra mundum

          but letís not forget the reverse function

      TIMTOWTDI exemplified!


      Peter L. Berghold -- Unix Professional
      Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (16)
As of 2015-07-06 14:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (75 votes), past polls