in reply to skip lines

Something along these lines, maybe?

# three-argument form of open() is safer open(my $input, '<', $filename ) || die "can't open $filename \n" ; my $in_header = 1; while (<$input>) { if (/Parameter/) { $in_header = 0; next; } next if $in_header; print $_; }
Perl 6 - links to (nearly) everything that is Perl 6.

Replies are listed 'Best First'.
Re^2: skip lines
by halligalli (Novice) on Jul 20, 2010 at 14:15 UTC
    thanks for the reply, i tried it on that way but "@data" is still the same as before....the header is still there......
      My example code doesn't use @input at all. But if you push $_ onto @input instead of printing it, you should get the desired result. (Note: start off with an empty @input array).
      Perl 6 - links to (nearly) everything that is Perl 6.
        thanks but its not working, i dont see the mistake in the code....
        my $in_header = 1; while (<@data>) { if (/Parameter/) { $in_header = 0; next; } next if $in_header; push(@data,$_); } print @data, "\n";
        i dont understand why to use "if...." because "Parameter" is always the first Value and always in my dataset...