Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 chilling in the Monastery: (10)
As of 2014-12-29 16:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (193 votes), past polls