!/usr/bin/perl -w use strict; my $x = "Finding fiNding fIndinG finding"; my $count = () = $x =~ /finding/ig; print "$count\n"; #prints 4