On Jan 8, 2008 2:33 PM, John W. Krahn <[EMAIL PROTECTED]> wrote:
> Robert Citek wrote:
> > $ ls | perl -e 'print "('\''" . join("'\'','\''", map { chomp; $_ }
> > (<>) ) . "'\'') \n" ; '
>
> $ ls | perl -le 'print "(", join ",", map( { chomp; "\047$_\047" } <> ),
> ")"'
Nice example of putting the single quotes around the elements in the
list. For some reason that code adds an extra comma (,) at the end.
However, if I use parentheses in the join, all's well:
$ ls | perl -le 'print "(", join(",", map( { chomp; "\047$_\047" } <> )), ")"'
Regards,
- Robert
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/