37,741
社区成员
发帖
与我相关
我的任务
分享open(FIL,"test.txt") or die $!;
while(<FIL>)
{
chomp;
$string="mum";
@list=split(/s+/,$string);
print "@list\n";
}open FIL,"test.txt" or die "$!";
for my $line (<FIL>) {
my @words = split /\s+/, $line;
for my $word (@words) {
if ($word =~ /mum/) {
print "$word\n";
}
}
}
close FIL;open(FIL,"test.txt") or die "$!";
while (<FIL>) {
print if /mum/;
}