in reply to removing leading 0's

Try "reading from a file":
use strict; use warnings; chomp(my $x = <DATA>); chomp(my $y = <DATA>); #$x += 0; if($x == $y) { print $x . " and " . $y . " are equal\n"; } else { print $x . " and " . $y . " aren't equal\n"; } __DATA__ 0010 10
OUTPUT: 0010 and 10 are equal

As numbers, they are equal. As strings, they are not! Note that your idea of adding zero would 'fix' the string.

Bill