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:
Ricardo Signes
Date:
July 30, 2014 00:04
Subject:
Re: New feature proposal : <<>> to disable magic open of ARGV
Message ID:
20140730000403.GA12631@cancer.codesimply.com
* Abigail <abigail@abigail.be> [2014-07-29T18:34:27]
> On Tue, Jul 29, 2014 at 05:54:24PM -0400, Ricardo Signes wrote:
> > 
> > I am gratified to see that <<X>> fails for any X, as you've only made the
> > 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".)

-- 
rjbs

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