in reply to Re: Printing Array with quote and comma
in thread Printing Array with quote and comma

As long as we're doing down the "other ways to do it" road...

my @arr = qw(book dog cat); { local $" = "','"; print "['@arr'];\n"; }

And if that one's not ugly enough, we can certanly take it down that path too...

my @arr = qw(book dog cat); $"='\',\'';print"['@arr'];$/";

...just having fun, of course.


Dave