diff --git a/lib/Subtitle/Utils.pm b/lib/Subtitle/Utils.pm index 7ccde74..991bc64 100644 --- a/lib/Subtitle/Utils.pm +++ b/lib/Subtitle/Utils.pm @@ -16,11 +16,11 @@ our %EXPORT_TAGS = ( timing => [qw(make_timing parse_timing)], ); -## string sunctions +## string functions sub chomp_all { - return unless @_; - return $_ =~ s/[\r\n]+$//o for @_; + return unless $_[0]; + $_[0] =~ s/[\r\n]+$//o; } sub strip_bom { @@ -29,8 +29,8 @@ sub strip_bom { } sub trim { - return unless @_; - $_ =~ s/(^\s+|\s+$)//go for @_; + return unless $_[0]; + $_[0] =~ s/(^\s+|\s+$)//go; } ## timing functions @@ -101,9 +101,9 @@ Subtitle::Utils -- usefull generic routines =head2 C chomp($line); - chomp($line1, $line2); In-place strips newlines (CR/LF) from line. +Differs from standart chomp() than strips '\r', '\n' and it's combinaion, disregarding $/ =head2 C