package My::Module; # Keep this next line at the very top, please: %msgs= (400=>"Bad Request",...); [...] use My::OtherModule; [...] sub msg { die "HTTP/1.0 $_[0] $msgs{$_[0]}\n"; }