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
How do you set environment variables in perl?
Explain perl. When do you use perl for programming?
You want to read command-line arguements with perl. How would you do that?
Differentiate between c++ and perl.
what is Polymorphism in Perl?
What is perl I used for?
Explain string comparison operators in perl.
How do you you check the return code of a command in perl?
Differentiate between arrays and list in perl.
What are different data types that perl supports. Elaborate on them.
What is the different between array and hash in perl programming?
What is goto statement in perl?
What are the options that can be used to avoid logic errors in perl?
Difference between the variables in which chomp function work ?
Explain perl one-liner?