Simple Negative Number Checking Subroutine in Perl
Many times we need to check whether a number is negative or not, here is a very simple subroutine to do that.
Code: Perl
sub isNegative { my($checkValue) = @_; if(abs($checkValue) != $checkValue) { # the value is negative return1; } else { # number is positive return0; } }