Subject: | [PATCH] Messages.pm will not run on 5.10 |
The scary globref behavior in Messages.pm will not function properly on
Perl 5.10. It relies on scary scary stupid glob things. The attached
patch replaces the code with something more reliable.
Subject: | rho-5.10.diff |
diff -Nur Rose-HTML-Objects-0.549/lib/Rose/HTML/Object/Messages.pm Rose-HTML-Objects-rjbs/lib/Rose/HTML/Object/Messages.pm
--- Rose-HTML-Objects-0.549/lib/Rose/HTML/Object/Messages.pm 2007-07-17 22:42:29.000000000 -0400
+++ Rose-HTML-Objects-rjbs/lib/Rose/HTML/Object/Messages.pm 2007-10-15 18:06:04.000000000 -0400
@@ -159,24 +159,20 @@
{
while(my($name, $thing) = each(%{"${class}::"}))
{
- my $fq_sub = $thing;
- my $sub = $thing;
+ my $fq_name = "$class\::$name";
+
+ next unless(defined *{$fq_name}{'CODE'} && $name =~ /^[A-Z0-9_]+$/);
- $sub =~ s/.*:://;
- $fq_sub =~ s/^\*//;
-
- next unless(defined *{$fq_sub}{'CODE'} && $name =~ /^[A-Z0-9_]+$/);
-
- my $code = $class->can($sub);
+ my $code = $class->can($name);
# Skip it if it's not a constant
next unless(defined prototype($code) && !length(prototype($code)));
# Should not need this check?
- next if($thing =~ /^(BEGIN|DESTROY|AUTOLOAD|TIE.*)$/);
+ next if($name =~ /^(BEGIN|DESTROY|AUTOLOAD|TIE.*)$/);
- $Debug && warn "$class ADD $name = ", &$fq_sub, "\n";
- $class->add_message($name, &$fq_sub);
+ $Debug && warn "$class ADD $name = ", $code->(), "\n";
+ $class->add_message($name, $code->());
}
}
}