How to count no of occurrence of a unique patterns in perl?

Answer Posted / ramya

while ($string =~ /<pattern>/g) { $count++ }

Is This Answer Correct ?    9 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can inheritance be used in perl? Explain with the help of an example.

704


What are the different instances used in cgi overhead?

755


What are scalar data and scalar variables?

828


Why do we use "use strict" in perl?

722


What are stdin, stdout and stderr?

685


What are the reasons that cookie server can’t handle multiple connections?

728


Which guidelines by Perl modules must be followed?

772


What is the difference between localtime() and gmtime() functions?

770


How can I implement the function overloading in Perl ? I read about the operator overloading, I do not know how to implement the function overloading. Thanks in advance ?

2673


Differentiate use and require?

685


How can arrays be tied?

688


What is it meants by '$_'?

692


What are numeric operators in perl?

720


What is the difference between perl array and perl hash?

712


Explain perl.

720