Browse Source

* Subtitle::BASE : add to_string() and to_file()

master
Alex 'AdUser' Z 6 years ago
parent
commit
8ecca08a6d
  1. 15
      lib/Subtitle/BASE.pm

15
lib/Subtitle/BASE.pm

@ -42,6 +42,21 @@ sub from_file {
return $self->parse(\@lines);
}
sub to_string {
my ($self) = @_;
return $self->build;
}
sub to_file {
my ($self, $path) = @_;
open my $FH, '>', $path
or return $self->log(error => "can't open file: $path -- $!");
print $FH $self->build;
close $FH;
return 1;
}
1;
=pod

Loading…
Cancel
Save