关于perl的问题 100:00:09,855 --> 00:00:14,724Britain was an object of desire.200:00:26,295 --> 00:00:31,847Tacitus declared it worth the conquest,300:00:32,015 --> 00:00:35,803the best complimentthat could occur to a Roman.如果以句号为分

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/03 16:02:46
关于perl的问题 100:00:09,855 --> 00:00:14,724Britain was an object of desire.200:00:26,295 --> 00:00:31,847Tacitus declared it worth the conquest,300:00:32,015 --> 00:00:35,803the best complimentthat could occur to a Roman.如果以句号为分

关于perl的问题 100:00:09,855 --> 00:00:14,724Britain was an object of desire.200:00:26,295 --> 00:00:31,847Tacitus declared it worth the conquest,300:00:32,015 --> 00:00:35,803the best complimentthat could occur to a Roman.如果以句号为分
关于perl的问题
1
00:00:09,855 --> 00:00:14,724
Britain was an object of desire.
2
00:00:26,295 --> 00:00:31,847
Tacitus declared it worth the conquest,
3
00:00:32,015 --> 00:00:35,803
the best compliment
that could occur to a Roman.
如果以句号为分割,把对应的时间合并起来,最后得到下面的结果:
1
00:00:09,855 --> 00:00:14,724
Britain was an object of desire.
2
00:00:26,295 --> 00:00:35,803
Tacitus declared it worth the conquest,
the best compliment
that could occur to a Roman.
perl菜鸟,望指教

关于perl的问题 100:00:09,855 --> 00:00:14,724Britain was an object of desire.200:00:26,295 --> 00:00:31,847Tacitus declared it worth the conquest,300:00:32,015 --> 00:00:35,803the best complimentthat could occur to a Roman.如果以句号为分
又问一遍,你上次迷信正则吧.我的答案不采纳
我实现了,但是bug都没判,最好只在每段字幕最后有一个句号.
字幕文件命名为 zimu.txt,会生成zimu_new.txt,放在一个目录下.
#!/usr/bin/perl -w
use strict;
use warnings;
main(@ARGV);
sub main
{
open(ZIMU,'