Help for this page
#! /usr/bin/perl use strict; ... my $x=1; my @arr= qw(foo cho roh foo kho foo moo foo); foreach(@arr){print $x++ if (/foo/)}
#! /usr/bin/perl use strict; ... $str=~ /foo/; print $&; #### In place of $&; we can use that for no #### for no. of matches.