package A; use strict; use Exporter qw(import); our @EXPORT = qw($maxlengths); our $maxlengths = { tinytext => 100, text => 200, mediumtext => 500, longtext => 2000 }; # and several others like this 1; package B; use strict; use A qw($maxlengths); # contrived sub check_form { my $self = shift; if (length($self->{address}) > $maxlengths->{tinytext}) { # code to trigger error } } 1;