Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

tie stdout with IO::Scalar

by jacques (Priest)
on Jan 27, 2005 at 04:09 UTC ( [id://425459]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        my $str;
         my $io = tie *STDOUT, 'IO::Scalar', \$str;
    ...
        untie *STDOUT;
           
            # $str now contains the output of the print_monks() function.
    
  2. or download this
    use Some::Module qw(print_blah);
    
    ...
            
            # print_blah() prints to stdout.
    

Log In?
Username:
Password:

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

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

    No recent polls found