Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Push and list context

by tphyahoo (Vicar)
on Mar 15, 2005 at 11:56 UTC ( [id://439598]=note: print w/replies, xml ) Need Help??


in reply to Push and list context

Putting arrays in quotes seems to be the same as joining them. That is, it adds spaces betweeen the elements. This works, and is real easy to read.
use warnings; use strict; my @array = qw/one two three/; my @reversed = reverse @array; print "@array @reversed", "\n";

Replies are listed 'Best First'.
Re^2: Push and list context
by Mugatu (Monk) on Mar 15, 2005 at 16:53 UTC
    Putting arrays in quotes seems to be the same as joining them. That is, it adds spaces betweeen the elements.

    Array interpolation uses $" as the separator, which defaults to a space, but can be changed to anything. Thus, "@array" is equivalent to join($", @array) (which I had in my earlier reply, but didn't really explain all the way).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-03-19 05:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found