Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Seeking enlightenment: is there a reason for this unusual syntax?

by dvergin (Monsignor)
on Feb 17, 2002 at 03:55 UTC ( [id://145950]=note: print w/replies, xml ) Need Help??


in reply to Seeking enlightenment: is there a reason for this unusual syntax?

Consider this:
my @ary = ('a','b','c','d'); print @ary; # prints "abcd" as four 1-char string values print "\n"; print "@ary"; # prints "a b c d" as a single string value
An array in double-quotes interpolates with the array values separated by the value of the special variable: $" (which is space by default).

So the line you cite creates a single string consisting of all the concatenated elements of @_ separated by spaces.

HTH, David
 

  • Comment on Re: Seeking enlightenment: is there a reason for this unusual syntax?
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (1)
As of 2024-04-19 18:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found