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

When does circular reference occur?

860


What rules must be followed by modules in perl.

953


What is the purpose of redo statement?

957


Does Perl have reference type?

897


How do find the length of an array?

1057


In Perl, what is grep function used for?

1018


Write the program to process a list of numbers.

927


Remove the duplicate data from @array=(“perl”,”php”,”perl”,”asp”)

936


what are the two ways to get private values inside a subroutine or block?

883


How can information be put into hashes?

919


What is an interpolation in perl?

936


What does the q{ } operator do?

852


How do you set environment variables in perl?

979


How to concatenate strings with perl?

803


How will you create a file in perl?

928