in reply to How do I output each Perl array element sourrounded in quotes?
#!/usr/bin/perl -- use strict; use warnings; my @Array = ("A", "B", "C"); my $text; if(@Array){ $text = join ' ', map { qq!"$_"! } @Array; } warn $text; $text = @Array ? join ' ', map { qq!"$_"! } @Array : ''; die $text; __END__ "A" "B" "C" at - line 12. "A" "B" "C" at - line 16.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I output each Perl array element sourrounded in quotes?
by almut (Canon) on Apr 18, 2009 at 13:25 UTC | |
by CountZero (Bishop) on Apr 18, 2009 at 17:48 UTC | |
by AnomalousMonk (Archbishop) on Apr 18, 2009 at 21:32 UTC |