From 9442904a09f5fceedb270d8f610ad8c03a2ef18a Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Thu, 30 Jun 2016 13:39:38 +1000 Subject: [PATCH] * Subtitle::SSA::Style->to_string() : fix fields separator --- lib/Subtitle/SSA/Style.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Subtitle/SSA/Style.pm b/lib/Subtitle/SSA/Style.pm index 7b57869..70208a8 100644 --- a/lib/Subtitle/SSA/Style.pm +++ b/lib/Subtitle/SSA/Style.pm @@ -81,15 +81,19 @@ sub to_string { my ($self) = @_; my @fields = $self->fields(); my $string = "Style: "; + my @values = (); foreach my $field (@fields) { my $d = $STYLE_DEFAULTS{$field}; + my $v = $self->{$f} // $d->{value}; if ($d->{type} eq 'x') { $fmt = ($self->{_vers} eq 'ass') ? '&H%08X' : '%d'; - $string .= sprintf $fmt, $self->{$f}; + $v = sprintf $fmt, $v; } else { - $string .= $self->{$f} // $d->{value}; + # use as is } + push @values, $v; } + $string .= join(',', @values); return $string; }