{
package BankAccount;
- use strict;
- use warnings;
use Moose;
has 'balance' => (isa => 'Num', is => 'rw', default => 0);
|| confess "Account overdrawn";
$self->balance($current_balance - $amount);
}
-
- package CheckingAccount;
- use strict;
- use warnings;
+
+ __PACKAGE__->meta->make_immutable(debug => 0);
+}{
+ package CheckingAccount;
use Moose;
extends 'BankAccount';
$self->deposit($overdraft_amount);
}
};
+
+ __PACKAGE__->meta->make_immutable(debug => 0);
}
my $savings_account = BankAccount->new(balance => 250);