package My::Language::Dutch; use strict; my %language = ( blue => 'blauw', red => 'rood', ); sub get_word { my $class = shift; my $word = shift || return; return $language{$word}; } 1; # IMPORTANT -- modules have to return a true value at the end #### use My::Language::Dutch; my $blue_dutch = My::Language::Dutch->get_word( 'blue' ); #### my $language = 'Dutch'; require "My/Language/$language.pm"; my $class = "My::Language::$language"; my $blue = $class->get_word( 'blue' );