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

Re: Join function

by toolic (Bishop)
on Oct 09, 2012 at 20:29 UTC ( #998065=note: print w/ replies, xml ) Need Help??


in reply to Join function

Double quotes interpolate variable values, and @- is a special variable. Use single quotes instead:

my $string = join ('-@-', sort@array); # My output # The string contains five-@-four-@-one-@-three-@-two

UPDATE: Here is a quote from perlop which I think is a handy bit of trivia:

"Punctuation" arrays such as @* are usually interpolated only if the name is enclosed in braces @{*}, but the arrays @_ , @+ , and @- are interpolated even without braces.


Comment on Re: Join function
Download Code
Replies are listed 'Best First'.
Re^2: Join function
by truthseeker66 (Novice) on Oct 10, 2012 at 13:16 UTC
    yes, it works. Thanks.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (16)
As of 2015-07-30 21:00 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 (273 votes), past polls