in reply to Here document construct problem
Are you sure $data is defined? and all elements in data? Have you tried dumping the %data-hash (using Data::Dumper)?
The code in your scratchpad does not show the definition of %data...
In Section
Seekers of Perl Wisdom