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
You want to open and read data files with perl. How would you do that?
Explain substr function in perl?
What does 'do' statement do in perl?
What are the advantages of c over Perl?
Explain chomp?
What interface used in PERL to connect to database? How do you connect to database in Perl?
How will you declare a variable in perl?
What are arrays in perl?
Why Perl aliases are considered to be faster than references?
Explain 'grep' function.
How do you set environment variables in perl?
What is “grep” function in perl?
How do I pass a command line argument in perl?
Is perl a case sensitive language?
How to open a directory in perl?