#!/usr/bin/perl use strict; use warnings; my $last; my @values; my $num; open FILE, 'test' or die $!; my @lines = ; foreach ( @lines ){ chomp; print; } @values = split "\n", @lines; $\ = "\n"; print @values; foreach ( @values ){ print $_; }