Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Push and list context

by tlm (Prior)
on Mar 15, 2005 at 02:37 UTC ( [id://439529]=note: print w/replies, xml ) Need Help??


in reply to Push and list context

It's hard to say what better/more elegant would be in the absence of some context. That said, if all I wanted to do was to print an array forwards and backwards, with spaces between the elements, I'd just do something like

my @array = qw(one two three); print "@{[@array, reverse @array]}\n";
If you need to keep the reverse array, then
my @yarra = reverse my @array = qw(one two three); print "@array @yarra\n";

the lowliest monk

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-19 17:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found