mauke / Function-Parameters

Function::Parameters - define functions and methods with parameter lists ("subroutine signatures")
https://metacpan.org/pod/Function::Parameters
18 stars 19 forks source link

Function::Parameters interferes with true #22

Closed schwern closed 1 year ago

schwern commented 9 years ago

CC: @chocolateboy

I found a strange interaction between Function::Parameters and true.pm.

# Foo.pm
package Foo;

use Function::Parameters;
use true;

fun foo() {}

If I load Foo.pm it's fine. But if I load it in a for loop...

$ perl -I ~/tmp/ -we 'for(0..1) { require Foo }'
Foo.pm did not return a true value at -e line 1.

That is very peculiar. Load order of Function::Parameters vs true does not matter. If I change fun foo to sub foo true.pm works again. If I call foo at the end of Foo.pm it works again, despite returning false.

I guess either Function::Parameters is doing something to the opcodes that true isn't expecting, or true is doing something naughty.

mauke commented 9 years ago

Data points:

mauke commented 1 year ago

No longer reproducible with the latest version of true. This is most likely the same issue as https://rt.cpan.org/Ticket/Display.html?id=124745, which was fixed in version 1.0.0 of https://github.com/chocolateboy/true.