in reply to Re: Re: How to route a format into a variable
in thread How to route a format into a variable
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: How to route a format into a variable
by ppm (Novice) on Feb 12, 2003 at 18:10 UTC | |
by runrig (Abbot) on Feb 12, 2003 at 18:16 UTC | |
|
Re: Re: Re: Re: How to route a format into a variable
by ppm (Novice) on Feb 12, 2003 at 18:17 UTC |