develooper Front page | perl.perl5.porters | Postings from October 2021

Re: v5.36, indirect, and multidimensional

Thread Previous | Thread Next
Nicolas Mendoza
October 11, 2021 15:48
Re: v5.36, indirect, and multidimensional
Message ID:

Den 11.10.2021 16:26, skrev Graham Knop:
> On Mon, Oct 11, 2021 at 2:39 PM Nicolas Mendoza <> wrote:
>> Note that using 'no indirect' basically just is what one would expect "use warnings 'indirect'" would've done.
>> I just realized I can't ensure all "indirect"-like syntax is treated as function calls (or other fitting syntax), which was what I really expected from the pragma/module.
>> Example code from a bug report I didn't submit now since I recalled the "indirect" chapter here:
>> …
> This is using the indirect CPAN module. I don't believe it is possible
> for a CPAN module to impact the parsing enough to prevent any code
> from being parsed as indirect, and can only do checks on the result.
> The core feature "no feature 'indirect';" works as you desire.

That's really great to hear ;)

> It is
> unfortunate that these two have different behavior, but it seems
> unavoidable.
Fair enough.
> It could be nice to have "use warnings 'indirect';" as a separate
> addition. Being able to fail on indirect calls, rather than silently
> treating them as function calls, can be valuable for writing code that
> is meant to work on older perl versions.
Perhaps. On the other hand, either you want the code to be using 
indirect notation, or you don't.

I guess it is only useful if you want the indirect feature to work, but 
find possible problems that you might want to fix, specially when there 
are collisions.

Not sure wether I would encourage the team to spend time adding that. 
Collision issues has already been there all the time, I guess one of the 
main reasons one wants to get rid of indirect notation.

One could argue that using function calls without parenthesis should be 
discouraged though, so perhaps a more generic warning is more suitable.


Nicolas Mendoza

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