in reply to chunking up texts correctly for online translation
my $ini_path = qw( /home/bob/Documents/html_template_data/3.values.ini + ); ... my $input_directory = qw( /home/bob/Documents/meditations/castaways/translate/data );
You are assigning a list to a scalar variable. This only works because there is only one element in the list. The correct way is to assign a scalar value to a scalar variable:
my $ini_path = '/home/bob/Documents/html_template_data/3.values.ini';
Or a list to a list:
my ( $ini_path ) = qw( /home/bob/Documents/html_template_data/3.values +.ini );
if ( $prompt1 eq ( "y" | "Y" ) ) { show_lang_codes(); }
$ perl -le'use Data::Dumper; my $x = ( "y" | "Y" ); print Dumper $x' $VAR1 = "y";
That code is only comparing $prompt1 to a lower case "y" but not to an upper case "Y". If you want to compare to both lower and upper case you can do the following:
if ( $prompt1 eq "y" || $prompt1 eq "Y" ) { show_lang_codes(); }
Or:
if ( lc $prompt1 eq "y" ) { show_lang_codes(); }
Or:
if ( $prompt1 =~ /\Ay\z/i ) { show_lang_codes(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: chunking up texts correctly for online translation
by bliako (Abbot) on Jun 15, 2019 at 08:55 UTC | |
by Aldebaran (Curate) on Jun 30, 2019 at 18:12 UTC | |
by bliako (Abbot) on Jul 01, 2019 at 08:58 UTC | |
by Aldebaran (Curate) on Jul 01, 2019 at 22:15 UTC | |
by bliako (Abbot) on Jul 01, 2019 at 23:21 UTC |