I have a perl script in which I do some arithmetic operations on hex values. One of them sometimes results in negative values and has to be converted to its 2\'s complement