summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-09-13 09:57:15 +0200
committerRafael Garcia-Suarez <rgs@consttype.org>2010-09-13 09:57:58 +0200
commit526fd1b4d7270fff44588238f2411032c109da6e (patch)
tree0bcb1eeef2931a321b0a5c150e44f0fd71ff45dd /t
parent25222ff958727e01a3a480924b65ba188c7c3ea2 (diff)
downloadperl-526fd1b4d7270fff44588238f2411032c109da6e.tar.gz
[perl #77684] Restore the 5.10/12 behaviour of open $fh, ">", \$glob_copy
This restores the perl 5.10/12 behaviour, making open treat \$foo as a scalar reference if it is a glob copy (SvFAKE). It also fixes an existing assertion failure that the test now trig- gers. PerlIOScalar_pushed was not downgrading the sv before set- ting SvCUR.
Diffstat (limited to 't')
-rw-r--r--t/io/open.t12
1 files changed, 11 insertions, 1 deletions
diff --git a/t/io/open.t b/t/io/open.t
index 01bfaca73f..5bbcb0b59b 100644
--- a/t/io/open.t
+++ b/t/io/open.t
@@ -10,7 +10,7 @@ $| = 1;
use warnings;
use Config;
-plan tests => 110;
+plan tests => 111;
my $Perl = which_perl();
@@ -337,3 +337,13 @@ fresh_perl_is(
',
'ok', { stderr => 1 },
'[perl #77492]: open $fh, ">", \*glob causes SEGV');
+
+# [perl #77684] Opening a reference to a glob copy.
+{
+ my $var = *STDOUT;
+ open my $fh, ">", \$var;
+ print $fh "hello";
+ is $var, "hello", '[perl #77684]: open $fh, ">", \$glob_copy'
+ # when this fails, it leaves an extra file:
+ or unlink \*STDOUT;
+}