# Setting the language # This one is to fool the compiler! Don't ask! use EN; # Testing if the language has allready be set or using the one defines by the browser # frdlang is my cgi language parameter my $q = new CGI; if ( $q->param("frdlang") ) { $syslang = uc($q->param("frdlang")); } elsif ( not $syslang ) { $syslang = uc(substr($ENV{HTTP_ACCEPT_LANGUAGE}, 0, 2)); } # Unloading language modules to force recompiling under mod_perl foreach my $lang ( grep(/DE.pm$|FR.pm$|EN.pm$/, keys(%INC)) ) { delete $INC {$lang}; } # Loading apropriate language module if ( uc($syslang) =~ /^DE/ ) { require DE; DE->import(); } elsif ( uc($syslang) =~ /^FR/ ) { require FR; FR->import(); } elsif ( uc($syslang) =~ /^EN/ ) { require EN; EN->import(); }