#!/usr/bin/perl use warnings; use strict; my $fh; open($fh, "<", "test.txt"); my @a = <$fh>; close($fh); my $i; foreach $i (@a) { print $i; }