Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
go ahead... be a heretic
 
PerlMonks  

Re: through an array in reverse

by blue_cowdawg (Prior)
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 (Prior) 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 browsing the Monastery: (8)
As of 2014-04-20 17:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls