$n=0;$m=2; sub l{ 'oXoXoXoX' =~ /(?:.X(?{return "Yes n=$n" if ++$n==$m}))*/ } print &l; 1 fails ?