Hello all,

I like format function, but I miss output to scalars.
write always print to STDOUT, or filehandle, but I need access
contents to scalar. I found in docs one solution, but it is not much
nice:

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;


...but when I have in formating template lets say 40 variables...
I'm just curious, if there are some other possibilities.

Thanks

/brano



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to