use IO::File; use Data::Dumper; my $fh = IO::File->new(); $fh->open(shift); my @lines = $fh->getlines(); undef $fh; print Dumper (@lines);