- or download this
delete $log_count{$a--} if it=0;
- or download this
delete $hash{some_destructive_function()} if it==0
- or download this
$code = c{ $a = 1; $b=2; print $a + $b}
- or download this
sub printer {
my $expr = shift;
...
}
}
}
- or download this
$adder_code = printer( c{ $x + $y } }
$adder_sub = compile($adder_code)
...
$pythago_sub = compile($pythago_code)
&{$pythago_sub}(3, 4)
# prints 5
- or download this
macro printer {
my $expr = shift;
...
}
}
}
- or download this
# printer is a macro, so $x + $y is not evaluated
$adder_sub = printer( $x + $y }
&{$adder_sub}(1, 2)
# prints 3
- or download this
macro aif {
my $condition = shift;
...
}
}
}
- or download this
aif(number_of_widgets(),
{
print "there are $it widgets\n";
}
)