if( $locale) { use locale; if( $word=~ /^\w+$/) { ... } } elsif( $utf8 and $perl_version_ok) { use utf8; if( $word=~ /^\w+$/) { ... } }