Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2014-10-23 11:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (125 votes), past polls