Skip to content

Commit

Permalink
ucd2c.pl shells out to rakudo, without checking that it ran correctly.
Browse files Browse the repository at this point in the history
The error message gets lost in its garrulous output.
  • Loading branch information
nwc10 committed Jun 27, 2020
1 parent bf6af07 commit 67c8413
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/ucd2c.pl
Expand Up @@ -14,6 +14,10 @@
# Download allkeys.txt from http://www.unicode.org/Public/UCA/latest/
# and place into a folder named UCA under the UNIDATA directory.

my $have_rakudo = `rakudo -e 'say "Hello world"'`;
die "You need rakudo in your path to run this script\n"
unless $have_rakudo =~ /\AHello world/;

my $DEBUG = $ENV{UCD2CDEBUG} // 0;

binmode STDOUT, ':encoding(UTF-8)';
Expand Down Expand Up @@ -2096,7 +2100,9 @@ sub Jamo {
}
}
my $hs = join ',', @hangul_syllables;
my $out = `perl6 -e 'my \@cps = $hs; for \@cps -> \$cp { \$cp.chr.NFD.list.join(",").say };'`;
my $out = `rakudo -e 'my \@cps = $hs; for \@cps -> \$cp { \$cp.chr.NFD.list.join(",").say };'`;
die "Problem running rakudo to process Hangul syllables: \$? was $?"
if $?;
my @out_lines = split "\n", $out;
my $i = 0;
for my $line (@out_lines) {
Expand Down

0 comments on commit 67c8413

Please sign in to comment.