From 70a66e9b16775c52b72e4363924380fc62c2d7e8 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Thu, 30 Jun 2016 15:09:14 +1000 Subject: [PATCH] * Subtitle::SSA::Style : update new() --- lib/Subtitle/SSA/Style.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Subtitle/SSA/Style.pm b/lib/Subtitle/SSA/Style.pm index 4b2b0e1..0948808 100644 --- a/lib/Subtitle/SSA/Style.pm +++ b/lib/Subtitle/SSA/Style.pm @@ -45,15 +45,17 @@ my %FIELDS = ( encoding => { type => 'd', value => 204, name => 'Encoding' }, ); +# options: +# * version - 'ssa' for v4 or 'ass' for v4+ sub new { my ($class, %opts) = @_; - my $self = {}; + my $self = { + _vers => 'ass', + }; bless($self, $class); if ($opts{version} and $opts{version} =~ m{^(ass|ssa)$}oi) { $self->{_vers} = lc($opts{version}); - } else { - $self->{_vers} = 'ass'; } my @fields = $self->fields();