Write a script for 'count the no.of digits using regular
expressions in perl..
Answer Posted / rajendran
($test,$number) = ("","");
$test = "12344tyyyyy456";
@test=split('',$test);
foreach(@test)
{
if ($_ =~ /\d/)
{$number++;
}
}
print $number;
Is This Answer Correct ? | 10 Yes | 3 No |
Post New Answer View All Answers
How many types of operators are used in the Perl?
Can we load binary extension dynamically?
Explain the default scope of variables in perl?
Explain perl. When do you use perl for programming?
What are scalar data and scalar variables?
What is the main function of cookie server?
How does polymorphism work in perl? Give an example.
What $! In perl?
How to close a file in perl?
Explain perl one-liner?
Explain string comparison operators in perl.
I have one question regarding to eval function. I know eval function is use for error checking but I am not able to understand below line. eval \'exec perl -S $0 ${1+\"$@\"}\' if 0; $0 for script name $@ set if error occur
Mention what is cpan?
What does delete function do in perl?
How to add elements in a hash in perl?