#!/usr/bin/env perl use strict; use warnings; my ($vt,$in,@array); $vt="foo.txt"; open(INFILE, $vt) or die "The file $vt could not be found.\n"; while(){ $vt=$_; chomp($vt); if (/^OBS ASH CLOUD/) { $in=1; } elsif (/^\n/) { $in=0; } next if ! $in; @array=split(/ /,$vt); print "@array"; #print "$vt\n"; }