summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2004-09-30 20:51:31 +0000
committerDave Mitchell <davem@fdisolutions.com>2004-09-30 20:51:31 +0000
commitac53db4c3f7e2209c2c3f33df2423b5511eedd24 (patch)
tree3cc642b808a44eabc82437cfdb13fcc6ef025de2 /t
parent476b65d99f3d74dcdd84fe0193db04f9db2c3d52 (diff)
downloadperl-ac53db4c3f7e2209c2c3f33df2423b5511eedd24.tar.gz
[perl #31767] open $1, "file" doesn't raise an exception
p4raw-id: //depot/perl@23342
Diffstat (limited to 't')
-rwxr-xr-xt/io/open.t8
1 files changed, 7 insertions, 1 deletions
diff --git a/t/io/open.t b/t/io/open.t
index 5e1b5ec80d..e12b4475d1 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 => 107;
+plan tests => 108;
my $Perl = which_perl();
@@ -315,3 +315,9 @@ fresh_perl_is(
'sub f { open(my $fh, "xxx"); $fh = "f"; } f; f;print "ok"',
'ok', { stderr => 1 },
'#29102: Crash on assignment to lexical filehandle');
+
+# [perl #31767] Using $1 as a filehandle via open $1, "file" doesn't raise
+# an exception
+
+eval { open $99, "foo" };
+like($@, qr/Modification of a read-only value attempted/, "readonly fh");