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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2016-09-28 02:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (518 votes). Check out past polls.