>>682
$text = <FILE>;
これだと、1行しか読めません。
$text .= $_ while(<FILE>);
でいいと思います。