#!/usr/bin/perl use strict; use warnings; my $dest_dir = "/home/test/"; my @data = ""; my $filename = "$dest_dir/test.txt"; my @lines = ""; open(INPUT,'<'.$filename ) || die "can't open $filename \n" ; @data=; #here I try to skip the header and print it into "@data" while( my $line = <@data> ) { next unless /Parameter/; print <@data> $line,"\n"; }