package GlobTest; BEGIN{ for my $method ( map { __PACKAGE__ . '::' . $_ } 0..9 ) { no strict 'refs'; *$method = sub { return $_ }; } } sub new { bless {}, shift }