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
Explain chomp, chop, cpan, tk.
Which has the highest precedence, List or Terms? Explain?
Why we use CGI?
Explain USE and REQUIREMENT statements?
Why to use perl?
How to read file into hash array ?
If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR} and *{"Foo::".EXPR}?
Explain lists and ivalue?
How will you access an element of a perl array?
You want to connect to sql server through perl. How would you do that?
Write a cgi program to show the header part?
What is boolean context?
How to dereference a reference?
Define dynamic scoping.
Explain the difference between die and exit in perl?