Have you tried the code posted here ?
In reply to Re^11: Mapping & Hash Issues by poj in thread Mapping & Hash Issues by sandeepsinghperl