in reply to Seeing if two numbers have the same sign

I learnt some simple trick at school involving abs

Possibly something like:
sub same_sign { abs($_[0] + $_[1]) == abs($_[0]) + abs($_[1]); }
Cheers,
Rob