in reply to Re^2: Dynamically adding methods to Moo class
in thread Dynamically adding methods to Moo class
Don't forget that Moo is still Perl. You can still do all the stuff you could normally do using Perl!
for my $t (qw/ INFO BINFO WINFO SCHMINFO /) { no strict 'refs'; *{lc $t} = sub { my $class = shift; $class->new( typ => $t, other => "@_" ); }; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Dynamically adding methods to Moo class
by McA (Priest) on Apr 23, 2014 at 16:54 UTC | |
by Arunbear (Prior) on Apr 24, 2014 at 12:51 UTC |