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 :-
My code isI am 60 years old I am 60 years old My code prints only 1 occurence not the successive ones. How to do tha +t ?
#!/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;
Back to
Seekers of Perl Wisdom