in reply to regex error puzzle
Update:
Don't use foreach (<FILE>) (which loads the entire file into memory) when while (<DATA>) (which reads the file one line at a time) suffices.
Also, your code is needlessly complicated. In fact, the regular expession that was giving you problems is completely useless. (It's used to modify $_ which is promptly discarded.) Your code simplifies to the following:
or# If you need the stuff in @data_out my @data_out; while (<DATA>) { next if /^\*{4}200[^6]/; push @data_out, $_; } print @data_out;
or# If you don't need @data_out while (<DATA>) { print unless /^\*{4}200[^6]/; }
# If you want something easy to read and # don't mind loading the entire file into memory. print grep { !/^\*{4}200[^6]/ } <DATA>;
|
|---|