http://www.perlmonks.org?node_id=136418


in reply to Re: multi-lingual support...
in thread multi-lingual support...

Note that if you want to be able to change the order of parameters you will need to add yet an other indirection layer...

update: Okay... I should check docs less recent then the latest development version. Read this as "you won't have to in the next version of perl".

Actually, you won't. To quote the sprintf docs:

Perl supports parameter ordering, in other words, fetching the parameters in some explicitly speci fied "random" ordering as opposed to the default implicit sequential ordering. The syntax is, instead of the "%" and "*", to use "%"digits"$" and "*"digits"$", where the digits is the wanted index, from one upwards. For example:
printf "%2\$d %1\$d\n", 12, 34; # will print "34 12\n" printf "%*2\$d\n", 12, 3; # will print " 12\n"
(... more stuff on this topic omitted ...)