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

How to create a package?

533


Explain perl one-liner?

525


What does the q{ } operator do?

525


Can you add two arrays together?

538


How to change a directory in perl?

558






What are the arguments and what do they mean in perl programming?

532


What are perl array functions?

541


what is Polymorphism in Perl?

553


How to open and read data files with Perl

615


Explain the difference between declarations of 'my' and 'local' variable scope in perl?

515


What does delete function do in perl?

528


What is epoch time in perl?

534


How will you get the count of parameters passed to a perl subroutine?

547


How to replace perl array elements?

539


Differentiate between c++ and perl.

610