If I understand you correctly, you will need to strip the comma out before storing it in the associative array. For example the following code:
#!/usr/bin/perl -w
%total=("apples", 123.45, "bananas", 2345.00, "oranges", 2,500);
foreach $fruit (sort keys(%total)) {...