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
How do I generate a list of all .html files in a directory?
explain the various functions/directives in perl that allow you to include/import a module. Also, state the differences between them.
What is the purpose of “_file_ literal” and “_line_ literal” in perl?
What is perl dbi?
what is the function that is used to identify how many characters are there in a string?
How will you access an element of a perl array?
What is Perl?
Define operators used in perl?
What is the difference between die and exit in perl?
Explain join function in perl?
Explain regular expression in perl?
You want to download the contents of a url with perl. How would you do that?
Explain the different types of data perl can handle.
How to concatenate strings with perl?
What syntax is used for grep() function?