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!
An organised event
A traditional gathering
With family and friends
I don't celebrate the New Year
Adjusting my clocks for the Leap Second
I can't remember
Results (257 votes). Check out past polls.