diff options
author | Daniel Chetlin <daniel@chetlin.com> | 2000-10-02 07:53:27 -0700 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-02 23:32:38 +0000 |
commit | 01bb7c6d67bc951562ed98068eba189cadd42374 (patch) | |
tree | 8a690ec57aeca12f1e60a5d90b22f5efaa807a7d /t/op | |
parent | b38af7adab46822ec7c92d231d7fbb058dc22c4c (diff) | |
download | perl-01bb7c6d67bc951562ed98068eba189cadd42374.tar.gz |
Fix aliasing of tied filehandles
Message-ID: <20001002145327.C1617@ilmd>
p4raw-id: //depot/perl@7110
Diffstat (limited to 't/op')
-rwxr-xr-x | t/op/tiehandle.t | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/t/op/tiehandle.t b/t/op/tiehandle.t index d7e6a78baf..b04bdb7897 100755 --- a/t/op/tiehandle.t +++ b/t/op/tiehandle.t @@ -77,7 +77,7 @@ package main; use Symbol; -print "1..29\n"; +print "1..33\n"; my $fh = gensym; @@ -149,3 +149,19 @@ ok($data eq "qwerty"); @expect = (CLOSE => $ob); $r = close $fh; ok($r == 5); + +# Does aliasing work with tied FHs? +*ALIAS = *$fh; +@expect = (PRINT => $ob,"some","text"); +$r = print ALIAS @expect[2,3]; +ok($r == 1); + +{ + use warnings; + # Special case of aliasing STDERR, which used + # to dump core when warnings were enabled + *STDERR = *$fh; + @expect = (PRINT => $ob,"some","text"); + $r = print STDERR @expect[2,3]; + ok($r == 1); +} |