in reply to Re: Perl = Greek to me
in thread Perl = Greek to me

Your last four lines have several problems

The showstoper? "=" is an assignment. You're looking for "=~"

And once you get your regex right, you can combine the ideas behind your while and print lines, like this:

if ( $line =~ /(regex)/ ) { print "$line\n"; } else { print "whoops. no match!\n";

And this may be my bad (for eyes being shot?) but what the heck is your

if $line =~ /_NN/;

supposed to be doing for you? I don't see that string anywhere in your data.

Update: Fixed markup & typos -- thanks to GrandFather for his attention and advice.