in reply to Appending print to a variable

Using sprintf will work, but i doubt that was what you were looking for. How about something more OO like IO::Scalar?
use strict; use warnings; use IO::Scalar; my $out = IO::Scalar->new(); $out->print("hello world\n"); $out->print(qw(foo bar baz), "\n"); print $out;
But .... why reinvent a wheel? There are a plethora of templating/embedding modules out there ... if you want to embed your Perl (bleh!), then i recommend HTML::Mason or Apache::ASP.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: (jeffa) Re: Appending print to a variable
by eric256 (Parson) on Jul 30, 2003 at 16:55 UTC

    Reinventing the wheel because i didn't like any of the templateing systems i had tried and because sometimes its fun to build a better mouse trap (so to speak!) Also no better way to learn than to try!

    ___________
    Eric Hodges