in reply to print htmlcode issue

$variable = STDOUT so that the STDOUT printing gets stored into the variable?

Not that way. You can however, tie a handle to a class. Fortunately for you, a module that does what you want already exists. Have a look at Tie::Handle::Scalar.

use Tie::Handle::Scalar; { local *STDOUT; # Don't want to override it forever tie *STDOUT, 'Tie::Handle::Scalar', \my $variable; print "Hello, world!\n"; print STDERR "\$variable contains: $variable"; }

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.