Ted Ashton writes:
: Thus it was written in the epistle of Segher Boessenkool,
: > 
: > The magic defined($_ = <FILE>) only happens if <FILE> is the only thing
: > inside while().
: > 
: > In this case, it's not (there's a chomp() inside as well), so the magic
: > doesn't apply.
: Ok.  One more time . . .
:   I'm proposing that we change that.

Before we get too carried away discussing the syntax of chomp, let's
look a bit at the semantics.  What's chomp supposed to work on if we
make $/ go away?  I think any discussion of chomp without considering
how the input discipline finds line terminators is destined to be a
partial solution.  If chomp exists in Perl 6 at all, I think it would
have to be some kind of method call on the string that figures out what
the discipline determined to be the terminator *for the current line*.
(Note that under Unicode, we might well have one line terminated with a
line separator, and the next line terminated with a page separator, and
the line after that terminated with a CFLF.)

On the other end, we're constrained to be able to translate current
uses of chop and chomp to something that will work in Perl 6, so we
can't just throw them out and say the input disciplines will do it all.
Even if chop and chomp are not longer the preferred way of doing it,
we'll still have to emulate the functionality somehow.


Reply via email to