This is probably a supremely dumb question, but that's never stopped me before. I feed off of the ridicule. :)
So what are the potential problems with doing the following in Moose?
use Moose; has 'why_pass_self' => { is => 'Str', default => 'dunno, is this ok?' +}; my $self; sub BUILD { my $s = shift; $self = $s; } sub _kool_func { print $self->why_pass_self; } sub kool_func_for_users { my $self = shift; $self->_kool_func; }
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
In reply to Why not use a local variable for $self in Moose? by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |