Hey Steve!
Just bumped into 2 small issues in 3 locations using 1.25. Diff attached.
- Does not properly check the case where $class is undefined, but @argz has values
- Does not report any problems encountered by eval { use $class }
Best,
Rob
Subject: | Trampoline.pm.diff |
--- Trampoline.pm.orig 2009-07-22 15:39:59.000000000 -0400
+++ Trampoline.pm 2009-07-22 15:40:14.000000000 -0400
@@ -52,8 +52,10 @@
shift;
- my ( $class, @argz ) = @_
- or croak "Bogus Object::Trampoline: missing destination class";
+ my ( $class, @argz ) = @_;
+
+ croak "Bogus Object::Trampoline: missing destination class"
+ unless (defined $class);
my $const = ( split /::/, $AUTOLOAD )[ -1 ];
@@ -88,8 +90,10 @@
# grab the destination class and its arguments off the stack.
# the constructor name is whatever is being autoloaded.
- my ( $class, @argz ) = @_
- or croak "Bogus Object::Trampoline: missing destination class";
+ my ( $class, @argz ) = @_;
+
+ croak "Bogus Object::Trampoline: missing destination class"
+ unless (defined $class);
my $const = ( split /::/, $AUTOLOAD )[ -1 ];
@@ -104,6 +108,9 @@
use $class;
};
+ croak "Failed to eval class: $@"
+ if ($@);
+
$class->$const( @argz )
};