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

Answer: How do I print an array with commas separating each element?

by Roy Johnson (Monsignor)
on Oct 29, 2003 at 20:41 UTC ( #303103=categorized answer: print w/replies, xml ) Need Help??

Q&A > arrays > How do I print an array with commas separating each element? - Answer contributed by Roy Johnson

$" can also be used for this:

local $" = ','; print "@arr\n";

  • Comment on Answer: How do I print an array with commas separating each element?
  • Download Code
Replies are listed 'Best First'.
Re: Answer: How do I print an array with commas seperating each element?
by QM (Parson) on Oct 29, 2003 at 20:48 UTC
    Should titles in answers be checked for spelling?

    Separate has a rat in it.

    Update: Of course, misspelling it may make it easier to search for.

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2021-01-21 21:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?