in reply to Re^4: Exporter/@ISA confusion
in thread Exporter/@ISA confusion
ok, that's probably what I needed to hear.
I just confirmed this with a test:
package Test::Class; use strict; use warnings; sub new { my ($className, $config) = @_; my $self = {}; bless $self, $className; $self->{config} = \%{$config}; return $self; } sub doSomething { my ($self, $what) = @_; print $self->{config}->{$what} . "\n";; } 1;
and the caller:
#!/usr/bin/env perl use strict; use warnings; use lib '.'; use Test::Class; my $t = Test::Class->new( { name => 'bob', } ); $t->doSomething('name');
...no need for noisy Exporter/@ISA nonsense. Nice and clean.
/me raises tankard!
|
|---|