This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
do-file should not force a bareword
[perl5.git] / t / op / do.t
index 5134fd4..177f1d2 100644 (file)
--- a/t/op/do.t
+++ b/t/op/do.t
@@ -302,4 +302,14 @@ SKIP: {
     ok($saved_errno,  "\$! set on io error");
 }
 
+# do subname should not be do "subname"
+{
+    my $called;
+    sub fungi { $called .= "fungible" }
+    $@ = "scrimptious scrobblings";
+    do fungi;
+    is $called, "fungible", "do-file does not force bareword";
+    isnt $@, "scrimptious scrobblings", "It was interpreted as do-file";
+}
+
 done_testing();