diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-04-09 12:39:35 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-04-09 12:39:35 +0000 |
commit | 3b82e551af39ddf336fbbcdb868f3bb50618183d (patch) | |
tree | 85ea1ca8ee1b9860a969302ec96a49aff890e833 /t/io | |
parent | 0c4b0a3f6df5172b70e3383e7419936faa3fc0a0 (diff) | |
download | perl-3b82e551af39ddf336fbbcdb868f3bb50618183d.tar.gz |
open(my $fh, ">&", STDOUT) should not warn under strict.
p4raw-id: //depot/perl@19173
Diffstat (limited to 't/io')
-rwxr-xr-x | t/io/open.t | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/t/io/open.t b/t/io/open.t index 300525ac05..09f2611d05 100755 --- a/t/io/open.t +++ b/t/io/open.t @@ -12,7 +12,7 @@ use Config; $Is_VMS = $^O eq 'VMS'; $Is_MacOS = $^O eq 'MacOS'; -plan tests => 99; +plan tests => 100; my $Perl = which_perl(); @@ -228,6 +228,11 @@ like( $@, qr/Bad filehandle:\s+afile/, ' right error' ); ok( open(my $stdout, ">&", \*STDOUT), 'dup \*STDOUT into lexical fh'); ok( open(STDOUT, ">&", $stdout), 'restore dupped STDOUT from lexical fh'); + { + use strict; # the below should not warn + ok( open(my $stdout, ">&", STDOUT), 'dup STDOUT into lexical fh'); + } + # used to try to open a file [perl #17830] ok( open(my $stdin, "<&", fileno STDIN), 'dup fileno(STDIN) into lexical fh'); } |