in reply to Printing Array with quote and comma
Or just use the existing functionality provided by Data::Dumper:
use Data::Dumper; $Data::Dumper::Indent = 0; my @arr = qw(book dog cat); print Dumper(\@arr);
If you want to do your way, then fix those ' and ":
my @arr = qw(book dog cat); print "[" . join(',', @arr) . "];\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Printing Array with quote and comma
by davido (Cardinal) on Oct 05, 2005 at 04:01 UTC |