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
You want to print the contents of an entire array. How would you do that?
What does the’$_’ symbol mean?
Mention the difference between die and exit in Perl?
What is the use of 'ne' operator?
Explain cpan?
What does `new $cur->{LINK}' do? (Assume the current package has no new() function of its own.)
What are the steps involved when the cgi program starts running?
When does circular reference occur?
How can I display all array element in which each element will display on next line in perl ?
explain the various functions/directives in perl that allow you to include/import a module. Also, state the differences between them.
How can we create perl programs in unix, windows nt, macintosh and os/2 ?
What is the difference between single (') and double (") quote in a string in perl?
Explain join function in perl?
package MYCALC; use Exporter; our @EXPORT = (); our @ISA = qw(Exporter); our @EXPORT_OK = qw(addition multi); our %EXPORT_TAGS = (DEFAULT => [qw(&addition)],Both => [qw(&addition & +multi)]); sub addition { return $_[0] + $_[1]; } sub multi { return $_[0] * $_[1]; } 1; Program: use strict; use warnings; my @list = qw (2 2); use Module qw(:DEFAULT); print addition(@list),"\n"; Above coding is my module MYCALC and the program which using this module, I have not exported any function using @EXPORT, but I have used the DEFAULT in %EXPORT_TAGS with the function addition, when I call this function from the main it says the error as,
Can we load binary extension dynamically?