| 1 | |||
| 2 | use File::Slurp ; | ||
| 3 | |||
| 4 | register_import_export_handlers | ||
| 5 | ( | ||
| 6 | svg => | ||
| 7 | { | ||
| 8 | IMPORT => undef , | ||
| 9 | EXPORT => \&export_svg, | ||
| 10 | }, | ||
| 11 | ) ; | ||
| 12 | |||
| 13 | sub export_svg | ||
| 14 | { | ||
| 15 | my ($self, $elements_to_save, $file) = @_ ; | ||
| 16 | |||
| 17 | if($self->{CREATE_BACKUP} && -e $file) | ||
| 18 | { | ||
| 19 | use File::Copy; | ||
| 20 | copy($file,"$file.bak") or die "export_pod: Copy failed while making backup copy: $!"; | ||
| 21 | } | ||
| 22 | |||
| 23 | write_file("$file.txt", {binmode => ':utf8'}, $self->transform_elements_to_ascii_buffer()) ; | ||
| 24 | |||
| 25 | qx"cat '$file.txt' | goat > '$file'" ; | ||
| 26 | qx"rm '$file.txt'" ; | ||
| 27 | |||
| 28 | return () ; | ||
| 29 | } | ||
| 30 |