NAME
Package::Transporter::Generator::Potential::After_END - Subroutines from the same package after END
SYNOPSIS
use Package::Transporter sub{eval shift}, sub {
my $generator = $_[0]->create_generator(
'::After_END', __FILE__);
$_[0]->register_potential($generator, 'FOR_SELF');
};
yn(!potentially_defined('hello_worlds'));
yn(potentially_defined('hello_world'));
yn(!defined(&hello_world));
hello_world();
yn(defined(&hello_world));
exit(0);
__END__
sub yn {
print STDOUT ($_[0] ? 'Yes' : 'No'), "\n";
}
sub hello_world {
print "Hello World.\n";
}
DESCRIPTION
Copies the missing subroutine from the same package itself, but after __END__.
Prototype definitions aren't supported, yet. No logging, no caching either. Breaks the taint concept by accidentally using $1 but without checking whether the file is trustworthy. (So much about the robustness of taint, the auditors nightmare.)
ANYTHING ELSE
Please see the documentation of the upstream package Package::Transporter.