agianni has asked for the wisdom of the Perl Monks concerning the following question:
#!perl use strict; use warnings; use Test::More qw( no_plan ); my $obj = GlobTest->new(); isa_ok( $obj, 'GlobTest' ); for my $method ( 0..9 ) { can_ok( $obj, $method ); } package GlobTest; BEGIN{ for my $method ( 0..9 ) { no strict 'refs'; *$method = sub { return $_ }; } } sub new { bless {}, shift }
Why can't I call those manufactured methods on the object? Shouldn't those typeglobs be in the GlobTest package space and therefor available as methods of a GlobType object?
perl -e 'split//,q{john hurl, pest caretaker}and(map{print @_[$_]}(joi +n(q{},map{sprintf(qq{%010u},$_)}(2**2*307*4993,5*101*641*5261,7*59*79 +*36997,13*17*71*45131,3**2*67*89*167*181))=~/\d{2}/g));'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Calling locally manufactured (typeglob) methods
by rhesa (Vicar) on Apr 05, 2007 at 15:55 UTC | |
by ysth (Canon) on Apr 05, 2007 at 16:37 UTC | |
by rhesa (Vicar) on Apr 05, 2007 at 18:34 UTC | |
|
Re: Calling locally manufactured (typeglob) methods
by agianni (Hermit) on Apr 05, 2007 at 15:51 UTC | |
by diotalevi (Canon) on Apr 05, 2007 at 17:06 UTC |