Skip to content
Create a gist now

Instantly share code, notes, and snippets.

SelectSaver vs Tie::Select
use SelectSaver;
use Tie::Select;
open my $fh1, '>', \my $var1;
open my $fh2, '>', \my $var2;
#Select Saver
my $sh1 = SelectSaver->new( $fh1 );
print "To var1";
# undef $sh1 here fixes this but now we are almost back to select()
my $sh2 = SelectSaver->new( $fh2 );
print "To var2";
print "Goes where?";
# Tie::Select
local $SELECT = $fh1;
print "To var1";
$SELECT = $fh2;
print "To var2";
print "To STDOUT";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.