Perlについての質問箱 46箱目
■ このスレッドは過去ログ倉庫に格納されています
0233デフォルトの名無しさん
2011/03/06(日) 10:39:37.86{
open(FILE,"<English.txt") or die print "File Error\nNot Fine English.txt";
open(FILEs,"<Japanese.txt") or die print "File Error\nNot Fine Japanese.txt";
srand;
$hello = rand;
$hello < 1 and $line = $_ while <FILE>;
$hello < 1 and $lines = $_ while <FILEs>;
close(FILE);
close(FILEs);
chomp ($line);
chomp ($lines);
print "$line > ";
chomp($input = <STDIN>);
if($lines eq $input)
{
print "正解\n";
} else {
print "不正解\n";
}
}
もとはこんな感じでテキストの中身を一行読み取って出力させるやつなのですが
一番最後の行しか読み込まないのです。。。
■ このスレッドは過去ログ倉庫に格納されています