This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [PATCH] Interesting syntax idea
authorSimon Cozens <simon@netthink.co.uk>
Fri, 29 Dec 2000 14:34:04 +0000 (14:34 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Fri, 29 Dec 2000 17:43:07 +0000 (17:43 +0000)
Message-ID: <20001229143404.A7762@deep-dark-truthful-mirror.perlhacker.org>

Tests for #8254.

p4raw-id: //depot/perl@8255

t/pragma/sub_lval.t

index 1b8b73a..a54075d 100755 (executable)
@@ -1,4 +1,4 @@
-print "1..47\n";
+print "1..49\n";
 
 BEGIN {
     chdir 't' if -d 't';
@@ -436,3 +436,16 @@ foobar() = 12;
 print "# '$newvar'.\nnot " unless $newvar eq "12";
 print "ok 47\n";
 
+# Testing DWIM of foo = bar;
+sub foo : lvalue {
+    $a;
+}
+$a = "not ok 48\n";
+foo = "ok 48\n";
+print $a;
+
+open bar, ">nothing" or die $!; 
+bar = *STDOUT;
+print bar "ok 49\n";
+unlink "nothing";
+