Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^5: Exporter/@ISA confusion

by qhen (Acolyte)
on Jun 11, 2014 at 11:41 UTC ( [id://1089519]=note: print w/replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1089519]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-25 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found