ファイルIO

超基本だけど、たまに忘れるので。

use IO::File;

my $fh = IO::File->new('./foo.txt','r') or die "cannot create file handle: $!";
my $line = $fh->getline;
$fh->close;

http://digit.que.ne.jp/work/wiki.cgi?Perl%E3%83%A1%E3%83%A2%2FIO%3A%3AFile%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB#i3