Skip to content
Snippets Groups Projects
Commit ddff6a6f authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

some debugging code

parent 63010c03
Branches
No related tags found
No related merge requests found
...@@ -51,11 +51,10 @@ sub write_json_file ...@@ -51,11 +51,10 @@ sub write_json_file
=begin comment =begin comment
open (J, '>:utf8', $json_fnm) or die ("can not write to [$json_fnm]"); open (J, '>:utf8', $json_fnm) or die ("can not write to [$json_fnm]; caller:", join (' ', caller()));
syswrite (J, $json_str); syswrite (J, $json_str);
close (J); close (J);
=end comment =end comment
=cut =cut
......
...@@ -204,12 +204,16 @@ sub save_as_csv ...@@ -204,12 +204,16 @@ sub save_as_csv
my $eol= shift || "\n"; my $eol= shift || "\n";
my $utf8= shift || 0; my $utf8= shift || 0;
unless (open (FO, '>' . $fnm)) unless (open (FO, '>', $fnm))
{ {
print "ATTN: cant save as csv [$fnm]\n"; print "ATTN: cant save as csv [$fnm]\n";
return undef; return undef;
} }
binmode (FO, ':utf8') if ($utf8); if ($utf8)
{
print "ATTN: binmode :utf8 [$fnm]\n";
binmode (FO, ':utf8');
}
print FO join ($csv_sep, @$column_names), $eol; print FO join ($csv_sep, @$column_names), $eol;
my $lines= 0; my $lines= 0;
...@@ -238,7 +242,7 @@ sub save_hash_as_csv ...@@ -238,7 +242,7 @@ sub save_hash_as_csv
my $eol= shift || "\n"; my $eol= shift || "\n";
my $utf8= shift || 0; my $utf8= shift || 0;
unless (open (FO, '>' . $fnm)) unless (open (FO, '>', $fnm))
{ {
print "ATTN: cant save as csv [$fnm]\n"; print "ATTN: cant save as csv [$fnm]\n";
return undef; return undef;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment