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 / arun janardhanan

Simple guys here we go :-).........


#!/usr/bin/perl -w

use strict;
my($test,$number) = ("","");
$test = "12344tyyyyy456";
$number = ($test =~ tr/[0-9]/[0-9]/);
print "Number of digits in variable is :- $number ";
exit;

Is This Answer Correct ?    11 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain chomp, chop, cpan, tk.

903


Which has the highest precedence, List or Terms? Explain?

868


Why we use CGI?

2512


Explain USE and REQUIREMENT statements?

894


Why to use perl?

908


How to read file into hash array ?

1053


If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR} and *{"Foo::".EXPR}?

964


Explain lists and ivalue?

922


How will you access an element of a perl array?

908


You want to connect to sql server through perl. How would you do that?

905


Write a cgi program to show the header part?

946


What is boolean context?

956


How to dereference a reference?

949


Define dynamic scoping.

855


Explain the difference between die and exit in perl?

853