This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Continue what #4494 started; introduce uid and gid formats.
[perl5.git] / lib / SelectSaver.pm
index 4c764be..5f56922 100644 (file)
@@ -38,8 +38,10 @@ use Symbol;
 
 sub new {
     @_ >= 1 && @_ <= 2 or croak 'usage: new SelectSaver [FILEHANDLE]';
-    my $fh = (@_ > 1) ? (select qualify($_[1], caller)) : select;
-    bless [$fh], $_[0];
+    my $fh = select;
+    my $self = bless [$fh], $_[0];
+    select qualify($_[1], caller) if @_ > 1;
+    $self;
 }
 
 sub DESTROY {