use IO::File; print $_->getlines for IO::File->new('foo', 'r');