http://qs321.pair.com?node_id=476116


in reply to Is it possible to store an arthimetric operator in a variable?

Sure:
sub _eq($$){ $_[0] == $_[1] ? 1 : 0 } sub _ne($$){ $_[0] == $_[1] ? 0 : 1 } my $op = \&_eq; print $op->( 1, 2 ) ? 'EQ' : 'NEQ'";
Edit: mrborisguy beat me to this answer while I was contemplating using tie to do it.