!/usr/bin/perl use warnings; use strict; my $file = '2016_5'; open(my $fh, "<", $file) or die; my @lines = <$fh>; close($fh); foreach my $i (@lines) { chomp($i); print "$i\n"; }