open (READ, "z:/test.txt") or die "unable to open file"; foreach () { push @array, $_; } foreach (@array) { print $_; }