in reply to Regex negative number question

You should check for a number before or after the decimal like so:

if ( $line =~ /-\d+\./ || $line =~ /-\d*\.\d+/ )

-. won't match.