sub regex2 { my $pat = shift; sub { my $count; ++$count while /$pat/iogx; $count }; }