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
Mention the difference between die and exit in Perl?
How to remove a directory in perl?
how to create a flat file database as shown below s.no name age city phone 0 hema 22 Calcutta 4312542 1 hema 21 Bangalore 2344345 2 ganesh 25 delhi 2445454 3 kartik 45 pune 4312121 4 santosh 25 Hyderabad 2254231 5 kumar 25 mysore 2344567 6 gita 34 mangalore 6532123 7 gita 32 pune 2213456 Q1.print the details of the person who r from bangalore q2.Replace the city name managlore to pune q3.prints no of person having name gita and hema q4.print how many are of age 25.
What are scalars in perl?
How interpreter is used in perl?
How do I read command-line arguments with Perl?
Explain tk?
How do I replace every character in a file with a comma?
What interface used in PERL to connect to database? How do you connect to database in Perl?
Explain substr function in perl?
What is v-strings?
what is the main function of fork() in cgi programming?
Which functions in perl allows you to include a module file. State their differences.
Write a program that shows the distinction between child and parent process?
Why Perl aliases are considered to be faster than references?