Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Moose - my new religion

by tobyink (Abbot)
on Jan 08, 2012 at 12:49 UTC ( #946859=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub current_balance {
      my $self = shift;
    ...
      }
      return $self->{current_balance};
    }
    
  2. or download this
    has current_balance => (is => 'rw', isa => 'Num');
    
  3. or download this
    package DebuggingDB;
    use Moose;
    ...
    {
      before $method => sub { warn "$method was called" };
    }
    
  4. or download this
    package DebuggingDB;
    use Moose::Role;
    ...
    {
      before $method => sub { warn "$method was called" };
    }
    
  5. or download this
    use Moose::Util qw/apply_all_roles/;
    apply_all_roles('DB', 'DebuggingDB') if $ENV{DEBUG};
    
  6. or download this
    my $accounts  = DB->new(...);
    my $marketing = DB->new(...);
    
    use Moose::Util qw/apply_all_roles/;
    apply_all_roles($marketing, 'DebuggingDB') if $ENV{DEBUG};
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://946859]
help
Chatterbox?
erix .oO( that sounds Boyer-Mooreish )
[Corion]: erix: Yes, but that's mostly for skipping characters you'll never read, but this approach skips the problem of needing to load more data while looking at a half-match

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (15)
As of 2016-12-06 15:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (108 votes). Check out past polls.