Is there a module or method of handling large hex numbers? I want to sort them into largest first order, it works fine for number of 8 characters or below, but anything above I get error messages:
Hexadecimal number > 0xffffffff non-portable at test.pl line 3.
Integer overflow in hexadecimal number at test 3.
#!/usr/bin/perl -w
@array=("3E1D302EDFDFDFDF", "3E1D", "4E1D302ECCCC6666", "4E1D302ECCCC6667","4E1D302DCCCC6666", "3E");
my @array= sort { hex($b) <=> hex($a) } @array;
foreach (@array) {
print "$_\n";
}
ALLIANCE & LEICESTER PLC, CONFIDENTIALITY NOTICE
This communication, and the information it contains
a) is intended for the addressee named above and for no other person or organisation, and
b) may be confidential and/or legally privileged and/or protected in law.
Access to this communication by anyone other than the addressee is unauthorised.
Unauthorised use, copying or disclosure of all or part of this communication is strictly prohibited and maybe unlawful.
If you are not the intended recipient, please contact the sender immediately by return e-mail and destroy all copies of this communication.
Alliance & Leicester plc is a member of the Legal & General Marketing Group, which is regulated by the FSA.
Alliance & Leicester plc only sells the life assurance and investment products of that group.
Alliance & Leicester plc, Registered office : Carlton Park, Narborough, Leicester LE19 0AL.
Company No: 3263713. Registered in England.
