That's really strange. Are you sure that $n1
are assigned with literal value as you do, and not from any external resources or inputs?
Update: Following your update, now we know that $n1 is splitted out from $some_string. But, where the heck this $some_string came from? It's the ultimate source of the data you need to tell so we know how is the data originally or initially the first time it arrives to the perl interpreter or your script. Don't emulate by literally assinging it to a variable if that's not actually the case since we'll just get nowhere.
$ cat diff.pl
my $n1 = '-933'; # the same result
my $n2 = '-1039'; # without quotes
my $diff = $n1 - $n2;
print "diff: $diff\n";
$ perl diff.pl
$ perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
osname=linux, osvers=2.6.9-22.18.bz155725.elsmp, archname=i386-lin
uname='linux hs20-bc1-6.build.redhat.com 2.6.9-22.18.bz155725.elsm
+p #1 smp thu nov 17 15:34:08 est 2005 i686 i686 i386 gnulinux '
Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!