- or download this
my %real_functions = (
wipe_system => sub { system "rm -rf /" },
...
: \%real_functions;
$funcs->{'wipe_system'}->();
- or download this
{
package SystemFunctions::Real;
...
: 'SystemFunctions::Debug';
$funcs->wipe_system();
- or download this
my %dispatch = (
incr => sub { $x++ },
decr => sub { $x-- },
);
$dispatch{$op}->();
- or download this
sub incr { shift; $x++ }
sub decr { shift; $x-- }
main->$op();