Ok, here's a sample program with some input data and resulting output. Is this what you mean?
use strict;
my @lines = <DATA>;
my $line;
foreach $line (@lines) {
if($line =~ /(test)/) {
print $1,"\n";
$line =~ s/<p>//gi;
}
if($line =~ /meta/) { print "$line" };
}
__END__
test <p> hello meta
fadfdsa <p> meta
fadfasd test
test <P> test meta
<p> fdafasdg
Every line containing "test" will cause a line with the word "test" in the output. Lines containing "test" and "meta" will have paragraph code tags stripped. Lines containing "meta" alone will be printed unchanged. Other lines will be skipped.
test
test hello meta
fadfdsa <p> meta
test
test
test test meta
|