Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by nite_man (Deacon)
on Feb 13, 2003 at 09:52 UTC ( #234932=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 nite_man

And another way:
map { print $_ . ($_ == $array[$#array] ? '' : ', ' ) } @array;

  • Comment on Answer: How do I print an array with commas separating each element?
  • Download Code
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 exploiting the Monastery: (7)
As of 2021-01-23 13:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?