With methods:
use feature ":5.14"; use warnings FATAL => qw(all); use strict; use Data::Dump qw(dump); sub Mine() {package __SUB__; eval "sub $_ {say \"$_\"}" for qw(hello goodbye); bless {} } my $a = Mine(); $a->hello(); $a->goodbye(); __END__ Produces: hello goodbye
There is a method to his madness. (Hamlet)
In reply to Re^3: a loop for creating subroutines?
by philiprbrenan
in thread a loop for creating subroutines?
by mascip
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |