develooper Front page | perl.perl6.language.io | Postings from September 2000

Re: "Standardization" of Perl IO functions

Thread Previous
From:
Nathan Wiger
Date:
September 12, 2000 20:30
Subject:
Re: "Standardization" of Perl IO functions
Message ID:
39BEF29F.9FAC8314@wiger.org
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

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About