Jon Ericson wrote:
>
> Is a problem with writing these the other way around as well:
>
> @file = readline open("</etc/motd") or die;
> print open(">>/var/log/logfile") "Hello, world!";
Currently - and by currently I mean that only RFC 14 was adopted and
everything else stayed the same - these would have to be written as:
@file = readline {open("</etc/motd")} or die;
print {open(">>/var/log/logfile")} "Hello, world!";
Since an indirect object can only be a scalar, block, or bareword.
However, this is not to stop us from "fixing" this in Perl 6
necessarily, and in fact I wrote RFC 174 with this in mind. However, a
more flexible approach is not without additional problems and
ambiguities, such as these:
http://www.mail-archive.com/perl6-language-subs%40perl.org/msg00202.html
http://www.mail-archive.com/perl6-language-subs%40perl.org/msg00206.html
http://www.mail-archive.com/perl6-language-subs%40perl.org/msg00205.html
http://www.mail-archive.com/perl6-language-subs%40perl.org/msg00208.html
http://www.mail-archive.com/perl6-language-subs%40perl.org/msg00213.html
Tom and Damian raise some excellent points that can't be ignored if this
were to become a reality.
-Nate