package DataDefs::Factory; use strict; use warnings; # define data here in 'my' variables ... my $hash_thing = { foo => 1, bar => 2, baz => 3, }; # and so on sub unshared_thing { # Called as a class method... my($class) = @_; # Make a copy of the data so that we'll not have # trouble elsewhere if the caller modifies it. my %copy = %{ $hash_thing }; return \%copy; } 1; #### use DataDefs::Factory; my $thingy = DataDefs::Factory->first_thing; #### ... use Clone qw(clone); ... sub first_thing { my($class) = @_; return clone($hash_thing); }