If you do end up deciding to go with this type of framework where you pass in code, please don't use string eval. That's yucky. You'd be better served with anonymous coderefs, along the lines of:
get_data( pre => undef, while => sub { my $content = shift; $content =~ tr/ / /s; return $content; }, post => sub { my $instances = shift; write_log("Found $count instances"); }, );
In reply to Re: Versatile subs
by revdiablo
in thread Versatile subs
by eff_i_g
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |