Subject: | Sub::Quote no_install + no_defer do not work as expected |
Given:
perl -MB::Deparse -MSub::Quote -e '
warn Sub::Quote->VERSION . "\n\n";
for (0, 0, 1) {
my $name = "Foo::bar$_";
my $cref = quote_sub(
$name,
"42",
{},
{ no_install => 1, no_defer => $_ }
);
warn "Created cref $cref:\n " . B::Deparse->new->coderef2text($cref) . "\n";
eval "warn $name()" or warn "$name not found: $@\n";
}
'
Latest indexed (2.001001) returns a deferred coderef during the last interation:
...
Created cref CODE(0x29f5490):
{
package Sub::Defer;
use warnings;
use strict;
$undeferred ||= undefer_sub($deferred_info->[3]);
goto \&$undeferred;
}
Foo::bar1 not found: Undefined subroutine &Foo::bar1 called at (eval 24) line 1.
Current master (1e2958cce1) correctly returns an un-deferred coderef, but disrespects 'no_install':
...
Created cref CODE(0x20cda60):
{
package Foo;
BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x00\x55\x51\x55\x00"}
'???';
package main;
42;
}
42 at (eval 25) line 1.