in reply to Re^2: How do I output each Perl array element sourrounded in quotes?
in thread How do I output each Perl array element sourrounded in quotes?
Try this:
print join ' ', map {qq("$_")} grep{$_} ('a', 'b', '', 'd', '', 'f');
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How do I output each Perl array element sourrounded in quotes?
by AnomalousMonk (Archbishop) on Apr 18, 2009 at 21:32 UTC |