Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

You want to open and read data files with perl. How would you do that?

873


Explain substr function in perl?

1025


What does 'do' statement do in perl?

987


What are the advantages of c over Perl?

923


Explain chomp?

921


What interface used in PERL to connect to database? How do you connect to database in Perl?

986


How will you declare a variable in perl?

962


What are arrays in perl?

962


Why Perl aliases are considered to be faster than references?

943


Explain 'grep' function.

972


How do you set environment variables in perl?

1034


What is “grep” function in perl?

991


How do I pass a command line argument in perl?

965


Is perl a case sensitive language?

1103


How to open a directory in perl?

1095