我写了以下程序,希望能成功。但我永远无法得到它。
my $fileName = 'myfile.txt';
print $fileName,"\n";
if (open MYFILE, "<", $fileName) {
my $Data;
{
local $/ = undef;
$Data = <MYFILE>;
}
my @values = split('\n', $Data);
chomp(@values);
if($values[2] eq '9999999999') {
print "Success"."\n";
}
}
myfile.txt 的内容是
160002
something
9999999999
700021