summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorSimon Cozens <simon@netthink.co.uk>2000-12-28 20:33:13 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-12-28 21:52:42 +0000
commitd804643f1d3e26c9c696bb1ebe8344dd5f1c8f6d (patch)
tree62c294e518d95ff78b72649c44e4f49b5eec3a30 /t
parent0d73d187eb6a7f76dde07ae608622944dbccd4e9 (diff)
downloadperl-d804643f1d3e26c9c696bb1ebe8344dd5f1c8f6d.tar.gz
Re: [PATCH] Warn on use of reference as array elem
Message-ID: <20001228203313.A2607@deep-dark-truthful-mirror.perlhacker.org> p4raw-id: //depot/perl@8234
Diffstat (limited to 't')
-rw-r--r--t/pragma/warn/pp_hot17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/pragma/warn/pp_hot b/t/pragma/warn/pp_hot
index 698255c064..5dd03801e1 100644
--- a/t/pragma/warn/pp_hot
+++ b/t/pragma/warn/pp_hot
@@ -47,6 +47,9 @@
Possible Y2K bug: about to append an integer to '19' [pp_concat]
$x = "19$yy\n";
+ Use of reference "%s" as array index [pp_aelem]
+ $x[\1]
+
__END__
# pp_hot.c [pp_print]
use warnings 'unopened' ;
@@ -228,3 +231,17 @@ $x = "19" . $yy . "\n";
EXPECT
Possible Y2K bug: about to append an integer to '19' at - line 12.
Possible Y2K bug: about to append an integer to '19' at - line 13.
+########
+# pp_hot.c [pp_aelem]
+{
+use warnings 'misc';
+print $x[\1];
+}
+{
+no warnings 'misc';
+print $x[\1];
+}
+
+EXPECT
+OPTION regex
+Use of reference ".*" as array index at - line 4.