in reply to Whats happening to my hash ref.

Dumper( $vars );
There is no need to dereference the hash and then rereference it in the call to Dumper. Apart from that it looks ok. If this is a cut'n'paste of the real code then adding use warnings and use strict may show something up. If not then maybe adding in the exact code causing the problem will help.