develooper Front page | perl.perl6.language | Postings from December 2004

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

Thread Previous | Thread Next
From:
Herbert Snorrason
Date:
December 4, 2004 08:34
Subject:
Re: Arglist I/O [Was: Angle quotes and pointy brackets]
Message ID:
c1b582150412040834438d0b9e@mail.gmail.com
On Sat, 4 Dec 2004 01:37:00 -0800, Larry Wall <larry@wall.org> wrote:
>     for =$*IN {...}
>     for =$*ARGS {...}
Yay. A generalised form of the input operator, which can create even
handier idioms for simple file processing. Maybe I wasn't clear
enough. My issue wasn't specifically with '.lines' for filter
behaviour -- as a replacement solely for the while (<>) { ... } idiom,
it would be quite adequate. But as a replacement for <OPENEDFILE>, it
is (IMO) sub-par, and definitely does add to the length of the whole.

As for the "nuclear blackmail" argument: One of the prime reasons I
like Perl is that different things look different. When everything
starts looking like a method call, that distinction rapidly drops
away.

>     $file = =<foo.c>;
Huh. That's really kinda neat.

> But here's the kicker.  The null filename can again represent the
> standard filter input, so we end up with Perl 5's
> 
>     while (<>) {...}
> 
> turning into
> 
>     for =<> {...}
Which is really short for 'for =@*ARGS {...}', then?

-- 
Schwäche zeigen heißt verlieren;
härte heißt regieren.
  - "Glas und Tränen", Megaherz

Thread Previous | Thread Next


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