develooper Front page | perl.perl5.porters | Postings from May 2022

Re: 5.36.0: bareword filehandles, indirect

Thread Previous | Thread Next
Christian Walde
May 14, 2022 20:53
Re: 5.36.0: bareword filehandles, indirect
Message ID:
On Sat, 14 May 2022 16:02:26 +0200, Ricardo Signes <> wrote:

> On Sat, May 14, 2022, at 09:57, Christian Walde wrote:
>> I use in every piece of code i can excuse it in, both privately, >>deployed to cpan and at work, and make sure i have indirect (and multidimensional and >>bareword::filehandles) installed.
> strictures does "no indirect" and not "no feature 'indirect'".  I believe these work in significantly different ways, and >am not sure how clearly the working-ness of one can be used as a test of the other.
> Perhaps someone would like to chime in on this.

That is true, and further feedback would be very good.


That said, after inspecting them myself:

no indirect; causes indirect-parsed calls to throw a warning which can be elevated to an error. This is useful in preventing code from doing the wrong thing.

no feature 'indirect'; appears to cause the parser not even consider the indirect parse path in the first place, meaning the code does what it was intended to do in the first place.

The latter is vastly more preferrable to me, personally. I am not being made to go back and change what i wrote.

I also suspect it serves as in/validation by way of logic:

The only way i can imagine it being problematic is if someone is used to writing indirect calls without being aware that that's what they are, has their code behave weirdly (e.g. local 'new' being used as a function instead of the indirect's 'new') and then is made to go back and change it.

If that is a serious concern it might actually be useful to delay it one release in order to not discourage people from taking advantage of the other changes in v36.

With regards,
Christian Walde
Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About