package FooConfig; use strict; [ constructor and some functions ] sub important_func { my $self = shift; my $arg = shift; my %hash = ( '1' => 'red', '2' => 'blue', '3' => 'green', ) return $hash{ $arg } if $hash{ $arg }; }