There is an example of a sprintf-like function emulating write in the Perl Formats documentation, reproduced below for convenience.
use Carp; sub swrite { croak "usage: swrite PICTURE ARGS" unless @_; my $format = shift; $^A = ""; formline($format,@_); return $^A; } $string = swrite(<<'END', 1, 2, 3); Check me out @<<< @||| @>>> END print $string;
--k.
In reply to Re: Re: Re: How to route a format into a variable
by Kanji
in thread How to route a format into a variable
by ppm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |