http://qs1969.pair.com?node_id=481648


in reply to Delete line if REGEX == true

Another way to directly remove unwanted lines is using Tie::File and greping those lines you want:
#!/usr/bin/perl use strict; use warnings; use Tie::File; my @text; tie @text, 'Tie::File', 'test_filter.txt' or die "Something went wrong: $!\n"; @text = grep { !/,,,,,/ } @text; untie @text; exit;