in reply to Re: using map
in thread using map
printf qq{'$_' } for @digits;
The correct format for printf is printf FORMAT_STRING, LIST so that should be:
printf q{'%s' }, $_ for @digits;
But you don't really need the extra overhead of using printf:
print qq{'$_' } for @digits;
But that wouldn't work properly because of your use of the -l switch which will add a newline after every print. Of course you could do something like this:
print join ' ', map "'$_'", @digits;
Which also avoids the extra space character at the end of the line.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: using map
by BrowserUk (Patriarch) on May 06, 2012 at 05:56 UTC | |
by tobyink (Canon) on May 06, 2012 at 06:37 UTC | |
by jwkrahn (Abbot) on May 06, 2012 at 07:21 UTC | |
by tobyink (Canon) on May 06, 2012 at 07:24 UTC | |
by BrowserUk (Patriarch) on May 06, 2012 at 07:32 UTC | |
by Anonymous Monk on May 06, 2012 at 08:17 UTC | |
by BrowserUk (Patriarch) on May 06, 2012 at 08:45 UTC | |
|
Re^3: using map
by AnomalousMonk (Archbishop) on May 06, 2012 at 05:23 UTC |