http://www.perlmonks.org?node_id=722771

ashnator has asked for the wisdom of the Perl Monks concerning the following question:

I want to print the matches successively in a column but its printing only the first one
Example :-
I am 60 years old I am 60 years old My code prints only 1 occurence not the successive ones. How to do tha +t ?
My code is
#!/usr/bin/perl -w $fn=<>; open(FH, "$fn") || die("Can't open:$!"); while(<FH>) { if($_ =~ /\w\s+\w+\s+\w+\s+\w+\s+\w+/) { print "$_"; } } close FH;