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:
demerphq
Date:
July 25, 2014 06:10
Subject:
Re: New feature proposal : <<>> to disable magic open of ARGV
Message ID:
CANgJU+VVf5yCuvHGAJVsiW595TSQY24Fdcx_H-rXRMxER2UGiw@mail.gmail.com
On 24 July 2014 17:51, Rafael Garcia-Suarez <rgs@consttype.org> wrote:

> I believe that this was discussed here some years ago, and that this
> was suggested by TomC. Anyway, I pushed a patch on rgs/nomagicopen.
> The patch is incomplete as it lacks docs and tests. I welcome feedback
> on the intent of the feature.
>
> commit 7f5bb3418c4fc2d6e2523bf918a7d9e33f9a7acc
> Author: Rafael Garcia-Suarez <rgs@consttype.org>
> Date:   Thu Jul 24 17:43:29 2014 +0200
>
>     Introduce the double-diamond operator <<>>
>
>     This operator works like <> or <ARGV>, as it reads the list of file
>     names to open from the command-line arguments. However, it disables
>     the magic-open feature (that forks to execute piped commands) :
>
>         $ bleadperl -e 'while(<>){print}' 'echo foo |'
>         foo
>         $ bleadperl -e 'while(<<>>){print}' 'echo foo |'
>         Can't open echo foo |: No such file or directory at -e line 1.
>


+1 on your original implementation.

I am sad that the very first reply to your proposal was a bike-shed
comment, and by the pumpking too.

I expect we will bike shed this to death.

Yves


---
perl -Mre=debug -e "/just|another|perl|hacker/"

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