Is there an easy way to print out a Perl array with commas in between each element?
Writing a for loop to do it is pretty easy but not quite elegant....
For inspection/debugging check the Data::Printer module. It is meant to do one thing and one thing only:
display Perl variables and objects on screen, properly formatted (to be inspected by a human)
Example usage:
use Data::Printer;
p @array; # no need to pass references
The code above might output something like this (with colors!):
[
[0] "a",
[1] "b",
[2] undef,
[3] "c",
]