in reply to Re^2: looping regex
in thread looping regex

You don't need to populate an array just to get a count of the times the pattern matches.
my $count = () = $filetext =~ /[\w._+-]+\@[\w.-]+/g; if ( $count > 50 ) { #success! }