in reply to Is it possible to store an arthimetric operator in a variable?
Sure:
Edit: mrborisguy beat me to this answer while I was contemplating using tie to do it.sub _eq($$){ $_[0] == $_[1] ? 1 : 0 } sub _ne($$){ $_[0] == $_[1] ? 0 : 1 } my $op = \&_eq; print $op->( 1, 2 ) ? 'EQ' : 'NEQ'";
In Section
Seekers of Perl Wisdom