Nathan Wiger wrote:
> This is an idea I've been chewing on for some time. RFC 14 proposes a
> new syntax to open():
>
> $FH = open dir "/usr/local/bin" or die "Badness: $!";
>
> which is far different from the current open(). This is actually a more
> flexible and consistent syntax, with a cool feature I just came across
> the other day:
>
> @file = open("</etc/motd")->readline or die;
> open(">>/var/log/logfile")->print("Hello, world!");
The first line is used so often that it could be written:
@file = <"/etc/motd">; # RFC 51
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!";
Jon
--
Knowledge is that which remains when what is
learned is forgotten. - Mr. King