App-SubtitleUtils

 view release on metacpan or  search on metacpan

script/vtt2srt  view on Meta::CPAN

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
our $DATE = '2024-01-13'; # DATE
our $DIST = 'App-SubtitleUtils'; # DIST
our $VERSION = '0.013'; # VERSION
 
sub _strip {
    my $str = shift;
    $str =~ s/<.+?>//g;
    $str;
}
 
$/ = "";
my $num = 1;
while (my $para = <>) {
    unless ($para =~ /\A([0-9][^\n]+)(.+)/s) {
        log_trace "Paragraph does not begin with a digit, skipping";
        next;
    }
 
    my ($first_line, $subseq_lines) = ($1, $2);
 
    $first_line =~ s/[.]/,/g;



( run in 0.396 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )