sub make_bin_ops { my $op = shift; return sub { my ($a, $b) = @_; return eval "$a $op $b"; } } my ($div_OP) = make_bin_ops('/');