Write a script for 'count the no.of digits using regular
expressions in perl..
Answer Posted / anandan
#!/usr/bin/perl -w
use strict;
my($test,$number) = ("","");
@test = "12344tyyyyy456";
foreach(@test)
{
if ($_ =~ /\d/)
{$number++;
}
}
print $number;
| Is This Answer Correct ? | 5 Yes | 15 No |
Post New Answer View All Answers
When does circular reference occur?
What rules must be followed by modules in perl.
What is the purpose of redo statement?
Does Perl have reference type?
How do find the length of an array?
In Perl, what is grep function used for?
Write the program to process a list of numbers.
Remove the duplicate data from @array=(“perl”,”php”,”perl”,”asp”)
what are the two ways to get private values inside a subroutine or block?
How can information be put into hashes?
What is an interpolation in perl?
What does the q{ } operator do?
How do you set environment variables in perl?
How to concatenate strings with perl?
How will you create a file in perl?