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
What is perl? What is the basic command to print a string in perl?
What does cgi program store?
Differentiate between c++ and perl.
When do you use perl programming?
How will you get the count of parameters passed to a perl subroutine?
What is the difference between use and require in perl programming?
What is the use of –w?
Can we load binary extension dynamically?
You want to open and read data files with perl. How would you do that?
What is the purpose of redo statement?
Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?
Comment on array slicing and range operator
What are different data types that perl supports. Elaborate on them.
Demonstrate subroutines in perl with a simple example.
Explain about the applications of perl?