« blib/lib/App/Asciio/GTK/Asciio/Menues.pm
↑ Summary
blib/lib/App/Asciio/setup/import_export/asciioe.pl »
| 1 | |||
| 2 | use File::Slurp ; | ||
| 3 | |||
| 4 | register_import_export_handlers | ||
| 5 | ( | ||
| 6 | txt => | ||
| 7 | { | ||
| 8 | IMPORT => undef , | ||
| 9 | EXPORT => \&export_ascii, | ||
| 10 | }, | ||
| 11 | ) ; | ||
| 12 | |||
| 13 | use File::Slurp ; | ||
| 14 | |||
| 15 | sub export_ascii | ||
| 16 | { | ||
| 17 | my ($self, $elements_to_save, $file) = @_ ; | ||
| 18 | |||
| 19 | if($self->{CREATE_BACKUP} && -e $file) | ||
| 20 | { | ||
| 21 | use File::Copy; | ||
| 22 | copy($file,"$file.bak") or die "export_pod: Copy failed while making backup copy: $!"; | ||
| 23 | } | ||
| 24 | |||
| 25 | my $saved = write_file($file, {binmode => ':utf8'}, $self->transform_elements_to_ascii_buffer()) ; | ||
| 26 | |||
| 27 | return $saved ; | ||
| 28 | } | ||
| 29 |