Help for this page

Select Code to Download


  1. or download this
        use Encode;
        binmode STDOUT, ':encoding(UTF-8)';
    ...
        my $en = 'Hello';
        printf "English: %s, Russian: %s\n",
            $en, MyPackage::ru::translate($en);
    
  2. or download this
        package MyPackage::ru;
    
        use utf8; # Tells Perl to interpret this source file as utf8
    ...
        );
    
        sub translate { $trans{ lc $_[0] } || croak 'No translation for '.
    +$_[0] }