develooper Front page | perl.perl5.porters | Postings from July 2014

Re: New feature proposal : <<>> to disable magic open of ARGV

Thread Previous | Thread Next
From:
David Nicol
Date:
July 30, 2014 01:07
Subject:
Re: New feature proposal : <<>> to disable magic open of ARGV
Message ID:
CAFwScO8oL2WWP2aReQVSzJ7F7vZEgxm6MdLbBmGuw+k6V84yhA@mail.gmail.com
>> > literal construct <<>> iterate.  Awesome.  I think we're going to want a
>> > better error message, if possible, though, than:
>> >
>> >   ~/code/perl5$ ./perl -e 'while (<<ARGV>>) { print }' 'ls |'
>> >   Can't find string terminator "ARGV" anywhere before EOF at -e line 1.
>>
>> That may be hard, as this:
>>
>>     while (<<ARGV>>3) {print}
>>     ARGV
>>
>> is legal syntax.
>
> Yeah, the error that I got made it clear that it would be tricky.  If we can't,
> we can't, but if we can, we should.  (For non-absurd-effort levels of "can".)

somewhere in this archive is a patch I submitted once to allow
whitespace between a
left-shift that begins an expression and a bareword that isn't an
infix operator (to allow
using the deprecated empty terminator, which is what that always
confusingly misparses as,
to precede C<le> for instance) and that might be a good starting place

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