in reply to Re: File Filtering... Help
in thread File Filtering... Help

<massage> #!/usr/bin/perl -w use strict; my $file = shift; #always! my $start = quotemeta shift; #quote meta chars my $end = quotemeta shift; #quote meta chars my $outfile = "$file.out"; open(IN, "<$file") || die "Can't open $file!\n"; open(OUT, ">$outfile") || die "Can't open $outfile!\n"; my $file_contents = do {local $/; <IN>}; #slurp! while ($file_contents =~ /($start.*?$end)/gs) { print OUT $1, "\n"; } </massage> __infile__ blah blah blah #BG blah blah blah blah blah blah #EN blah blah blah blah #BG blah #EN blah blah blah blah __infile.out__ #BG blah blah blah blah blah blah #EN #BG blah #EN

--

flounder