Hi
I want to use sprintf for generating a string that contains a repeated set of arguments, and wanted to not have to specify the arguments multiple times, I found a way to do it (using %[n]$s), and the example below works.
perl -e 'printf q{%2$s %1$s - %2$s %2$s}, "world", "hello"'The problem is I haven't found any mention of it in the camel book, and a quick search here didn't turn up anything. Is it safe to use this, or is this something that is not likely to be universally implemented?. If it is safe to use, why isn't it mentioned in the camel book?
Prowler
- Spelling is a demanding task that requies you full attention.
In reply to (s)printf using argument selection by prowler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |