I don't know if it is important for the OP, but your code doesn't find overlapping instances:
my $count =()= 'abrabrabrabra' =~ /brabra/g; print "Found $count instances\n" # prints Found 2 instances (not 3)
Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."
In reply to Re^2: Find number of short words in long word
by psini
in thread Find number of short words in long word
by sedm1000
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |