#!/usr/bin/perl use strict; use warnings; use base 'Class::Data::Inheritable'; my %data = ( "blah"=>1, "boo"=>2, "hoo"=>3 ); # assign each key to a variable of the same name foreach (keys %data) { # no strict; __PACKAGE__->mk_classdata($_, $data{$_}); } # end-foreach print blah(); exit;