in reply to how to get value of print command
Maybe this is what you want:
open( STDOUT, '>', \( my $output ) )
or die "Can't open in-memory file: $!";
print "Hello world!\n"; # prints to $output
print STDERR 'STDOUT: ' . $output;
STDOUT: Hello world!
1. Keep it simple
2. Just remember to pull out 3 in the morning
3. A good puzzle will wake me up
Many. I like to torture myself
0. Socks just get in the way
Results (299 votes). Check out past polls.