Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: how to get value of print command

by jau (Hermit)
on May 13, 2010 at 08:29 UTC ( #839796=note: print w/replies, xml ) Need Help??


in reply to how to get value of print command

Maybe this is what you want:

#!/usr/bin/perl use strict; use warnings; close STDOUT; open( STDOUT, '>', \( my $output ) ) or die "Can't open in-memory file: $!"; print "Hello world!\n"; # prints to $output print STDERR 'STDOUT: ' . $output;

Output:

STDOUT: Hello world!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://839796]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2017-02-25 17:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (366 votes). Check out past polls.