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

Re: Angle quotes and pointy brackets

From:
Jon Ericson
Date:
December 1, 2004 11:54
Subject:
Re: Angle quotes and pointy brackets
Message ID:
rcg4qj5n69x.fsf@Jon-Ericson.sdsio.prv
Larry Wall <larry@wall.org> writes:

> On Tue, Nov 30, 2004 at 03:03:38PM -0800, Jon Ericson wrote:

> :   while(<>) {...}

> You left out the most important phrase:
>
>     "or whatever we decide is the correctest idiom."

I saw that, but I didn't know what to make of it.  The Perl 5 idiom is
pretty magic and I don't know if it's correcter to make it more or
less explicit:

  for *$ARGV {...}

Only I wonder if the magic handle should be called $INPUT or
something.

> So if, as has been pointed out, @$handle is too much role shear, then we
> probably go with something like
>
>     for *$handle {...}
>
> in which case, if there's no handle, it seems to degrade to
>
>     for * {...}
>
> which seems amazingly something or other.

Lovely?  But I'm afraid of extra typing. ;-) It looks like the shell
idiom:

  for f in *; do ...; done

Jon




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