Write a script for 'count the no.of digits using regular
expressions in perl..
Answer Posted / santha
$testnumber='34535sssss24';
$numbercount=0;
while($testnumber=~m{\d}igs)
{
$numbercount++;
}
print "\n $numbercount";
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
When would `local $_' in a function ruin your day?
Remove the duplicate data from @array=(“perl”,”php”,”perl”,”asp”)
For a situation in programming, how can you determine that Perl is a suitable?
What is the purpose of goto expr statement?
Suppose an array contains @arraycontent=(‘ab’, ‘cd’, ‘ef’, ‘gh’). How to print all the contents of the given array?
What is warn function in perl?
Explain tk?
What are some of the key features of objects in perl?
What are stdin, stdout and stderr?
What is hash?
Explain USE and REQUIREMENT statements?
How do you turn on the perl warnings?
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,
Explain different types of perl operators.
How do I read command-line arguments with Perl?