elt 0 0 is й
elt 0 1 is
elt 0 2 is
elt 0 3 is л
elt 0 4 is
elt 0 5 is
elt 0 6 is с
elt 0 7 is
elt 0 8 is
Can't use string ("о") as an ARRAY ref while "strict refs" in use at template_stuff/utils1.pm line 61.
$
####
sub print_aoa_utf8 {
use warnings;
use 5.011;
use utf8; # a la François
use open OUT => ':encoding(utf8)';
use open ':std';
my $a = shift;
my @AoA = @$a;
for my $i ( 0 .. $#AoA ) {
my $aref = $AoA[$i];
for my $j ( 0 .. $#{$aref} ) {
print "elt $i $j is $AoA[$i][$j]\n";
}
}
return $a;
}
####
print "Make rus captions(y/n)?: ";
my $prompt1 = ;
chomp $prompt1;
if ( $prompt1 eq ( "y" | "Y" ) ) {
## delete existing files
foreach my $child ( $vars{rus_captions}->children ) {
my $success = $child->remove;
say "success deleting was $success";
}
my $ref_cap = make_russian_captions($rvars);
}
####
Make rus captions(y/n)?: y
success deleting was 1
success deleting was 1
success deleting was 1
success deleting was 1
matching are a.txt b.txt
rus_munge is /home/bob/2.scripts/pages/7.cw/template_stuff/translations/trans.07-01-2019-16-15-08.txt
rus_path is /home/bob/2.scripts/pages/7.cw/template_stuff/ruscaptions/a.txt
rus_path is /home/bob/2.scripts/pages/7.cw/template_stuff/ruscaptions/b.txt
####
sub make_russian_crossword {
use 5.011;
use warnings;
use POSIX qw(strftime);
use Path::Tiny;
use Encode;
use open OUT => ':encoding(UTF-8)', ':std';
use Data::Dumper;
my $rvars = shift;
my %vars = %$rvars;
my $munge = strftime( "p%d-%m-%Y-%H-%M-%S\.txt", localtime);
my $in_path = path( $vars{rus_captions}, $munge )->touchpath;
##Let mother know that you created a file, *verb* a reference:
$vars{log_file}=$in_path;
$rvars = \%vars; #does this line do anything for me?
# open file for writing
# my $fh = path($in_path)->openw_utf8; not helping
say "in make russian xword------";
my $data = $vars{cw_data};
#print Dumper $data;
print_aoa_utf8($data);
#print $fh $data;
my $a = $data;
my @AoA = @$a;
for my $i ( 0 .. $#AoA ) {
my $aref = $AoA[$i];
for my $j ( 0 .. $#{$aref} ) {
"$AoA[$i][$j]";
}
print "\n";
}
# ->append_utf8(@data);
return "nothing nyet"
}
####
##Let mother know that you created a file, *verb* a reference:
$vars{log_file}=$in_path;
$rvars = \%vars; #does this line do anything for me?