Subject: | Incorrect protoype for caller() |
Hook::LexWrap incorrectly overrides caller() by leaving out the
prototype. This is somewhat similar to the problems seen in
Contextual::Return[1] and Sub::UpLevel[2].
The attached patch fixes the problem.
The attached test probably isn't necessary, but it nicely illustrates
the reason this issue has come up.
[1] http://rt.cpan.org/Ticket/Display.html?id=26101
[2] http://rt.cpan.org/Ticket/Display.html?id=26100
Subject: | caller_prototype.patch |
--- /usr/local/share/perl/5.8.8/Hook/LexWrap.pm 2008-08-25 20:35:55.000000000 -0700
+++ LexWrap.pm 2008-08-25 20:35:41.000000000 -0700
@@ -3,7 +3,7 @@
use 5.006;
use Carp;
-*CORE::GLOBAL::caller = sub {
+*CORE::GLOBAL::caller = sub(;$) {
my ($height) = ($_[0]||0);
my $i=1;
my $name_cache;
Subject: | caller_prototype.t |
#!/usr/bin/perl
use strict;
use warnings;
use Test::More tests => 1;
use Test::NoWarnings;
use Sub::Uplevel;
use Hook::LexWrap;