while () { chomp; my @line = grep {!/^-/} split; print $line[0], ' ' , $line[4], "\n"; }