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 reply to Re: Is it possible to store an arthimetric operator in a variable?
by Adam
in thread Is it possible to store an arthimetric operator in a variable?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |