Browse Source

* Subtitle::SRT : update build() : use $self->{eol}

master
Alex 'AdUser' Z 8 years ago
parent
commit
b4a7a44b31
  1. 13
      lib/Subtitle/SRT.pm

13
lib/Subtitle/SRT.pm

@ -121,21 +121,20 @@ sub parse {
sub build {
my ($self) = @_;
my ($hrs, $min, $sec, $msec, $out);
my (@lines, $out);
$out = '';
foreach my $e (@{ $self->{events} }) {
$out .= $e->{id} . "\n";
push @lines, $e->{id};
my $start = sprintf $self->{timing_fmt},
make_timing($e->{timing}->[0]);
my $end = sprintf $self->{timing_fmt},
make_timing($e->{timing}->[1]);
$out .= sprintf "%s --> %s\n", $start, $end;
$out .= "$e->{text}\n";
$out .= "\n";
push @lines, sprintf("%s --> %s", $start, $end);
push @lines, $e->{text};
push @lines, "";
}
return $out;
return join($self->{eol} => @lines);
}
1;

Loading…
Cancel
Save