Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

How to write a Mixin without Exporter mess?

by saintmike (Vicar)
on Jul 06, 2009 at 22:13 UTC ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-19 05:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found