in reply to hexadecimal division

> What concept did I miss? 

perlnumber describes the correct notation of hexadecimal literals:

$n = 0x1234; # hexadecimal integer° HTH! :)

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Wikisyntax for the Monastery

update

°) hence my $divisor = 0x10; will avoid the division by zero

See also vexed by the hex!

UPDATE

details here Re^3: hexadecimal division (string to number casting only for decimal! numbers! )