Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

How to write a Mixin without Exporter mess?

by saintmike (Vicar)
on Jul 06, 2009 at 22:13 UTC ( #777695=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package Foo;
    use Mixin qw(frobnicate);
    ...
    
    my $foo = Foo->new();
    $foo->frobnicate();
    
  2. or download this
    package Mixin;
    use base 'Exporter';
    our @EXPORT_OK = qw(frobnicate);
    
    sub frobnicate { print "frobnicating!\n"; }
    
  3. or download this
    package Mixin;
    use base 'Exporter';
    ...
    }
    
    1;
    
  4. or download this
    use Mixin qw(frobnicate frobnerize);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://777695]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2015-07-07 06:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls