我在做Perl编程.我需要阅读一个段落并将每个句子打印出来作为一行.
谁知道怎么做?
以下是我的代码:
#! /C:/Perl64/bin/perl.exe
use utf8;
if (! open(INPUT, '< text1.txt')){
die "cannot open input file: $!";
}
if (! open(OUTPUT, '> output.txt')){
die "cannot open input file: $!";
}
select OUTPUT;
while (<INPUT>){
print "$_";
}
close INPUT;
close OUTPUT;
select STDOUT;
Run Code Online (Sandbox Code Playgroud)