in reply to skip lines

First off, your script does not compile; please make sure to test your code before posting it here. Next - no, your '@data' isn't going to change: you're populating it from a file, and never doing anything to change it. Try something like this, instead:

#!/usr/bin/perl -w use strict; open INPUT, '<', "/home/test/test.txt" or die "test.txt: $!\n"; my ($seen, @data); while(<INPUT>) { $seen++ if /^Parameter/; push @data, $_ if $seen; } close INPUT; print @data;

This will print out the content of '@data', which will only be populated per your requirements.


--
"Language shapes the way we think, and determines what we can think about."
-- B. L. Whorf

Replies are listed 'Best First'.
Re^2: skip lines
by halligalli (Novice) on Jul 21, 2010 at 07:32 UTC
    thanks oko1. it is working now