Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: print htmlcode issue

by Juerd (Abbot)
on Apr 19, 2002 at 10:39 UTC ( [id://160486]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://160486]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2024-04-25 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found