⭐ in reply to How do I print an array with commas separating each element?
$, = ','; print @array;
$, is the output field separator: print will insert whatever string has been assigned to $, between all of its arguments.
Note that if you use this technique, you should make your assignment to $, temporary by doing
local $, = ',';
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: Answer: Is there a quick way to print an array with commas seperation each element?
by davorg (Chancellor) on Aug 30, 2000 at 18:42 UTC |