Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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!


Comment on Re: how to get value of print command
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2014-09-19 11:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (137 votes), past polls