my $template = 'bar %s foo foo %s bar bar BAAAR!'; my $out = sprintf $template, 'Guybrush', 'Purcell';
Update: This is also a FAQ.
Update 2: This is also the Cookbook recipe of the day on perl.com. What a coincidence!
In reply to Re: Template strings
by trammell
in thread Template strings
by mclow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |