ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Scripts  >>  CGI Perl
 
 


 

 
 PHP interview questions  PHP Interview Questions
 ASP interview questions  ASP Interview Questions
 CGI Perl interview questions  CGI Perl Interview Questions
 JavaScript interview questions  JavaScript Interview Questions
 VB Script interview questions  VB Script Interview Questions
 JSP interview questions  JSP Interview Questions
 Shell Script interview questions  Shell Script Interview Questions
 Python interview questions  Python Interview Questions
 Tcl interview questions  Tcl Interview Questions
 Awk interview questions  Awk Interview Questions
 AJAX interview questions  AJAX Interview Questions
 Ruby on Rails interview questions  Ruby on Rails Interview Questions
 Scripts AllOther interview questions  Scripts AllOther Interview Questions
Question
Write a script for 'count the no.of digits using regular
expressions in perl..
 Question Submitted By :: Jkonakan
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Write a script for 'count the no.of digits using regular expressions in perl..
Answer
# 1
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 ?    4 Yes 1 No
Arun Janardhanan
 
  Re: Write a script for 'count the no.of digits using regular expressions in perl..
Answer
# 2
#!/usr/bin/perl -w 

use strict;
my($test,$number) = ("","");
@test = "12344tyyyyy456";
foreach(@test)
{
if ($_ =~ /\d/)
{$number++;
}
}
print $number;
 
Is This Answer Correct ?    3 Yes 4 No
Anandan
 
 
 
  Re: Write a script for 'count the no.of digits using regular expressions in perl..
Answer
# 3
($test,$number) = ("","");
$test = "12344tyyyyy456";
@test=split('',$test);
foreach(@test)
{
if ($_ =~ /\d/)
{$number++;
}
}
print $number;
 
Is This Answer Correct ?    4 Yes 1 No
Rajendran
 
  Re: Write a script for 'count the no.of digits using regular expressions in perl..
Answer
# 4
$testnumber='34535sssss24';
$numbercount=0;
while($testnumber=~m{\d}igs)
{
$numbercount++;
}
print "\n $numbercount";
 
Is This Answer Correct ?    3 Yes 1 No
Santha
 
  Re: Write a script for 'count the no.of digits using regular expressions in perl..
Answer
# 5
AEWT AWET
WEKLFJCM 
w?E:,f 
"W:lrc";E
 
Is This Answer Correct ?    1 Yes 1 No
Swdaer\zffgasdt
 

 
 
 
Other CGI Perl Interview Questions
 
  Question Asked @ Answers
 
How can you create an object of a class in a package? IBM4
Which web site will help the student to download the Java mini Project ?  1
Write a script for 'count the no.of digits using regular expressions in perl.. AppLabs5
write a script to generate n prime no.s? Persistent2
what r the future opportunities in PERL/LINUX after 3 years ??  2
Can any1 tell me 2 write the script using perl script 2 looking at a log file 2 see wheather the test has passed or not. TCS2
write a script to display mirror image of a entered value and also check whether Palindrome Persistent2
What is the Common Gateway Interface?  2
how to install a package in perl ????  2
what is the procedure to define a user define module in your perl application? IBM1
What is caller function in perl?  1
Name an instance where you used a CPAN module? TCS3
What is the difference between chop & chomp functions in perl? Cap-Gemini5
What arguments do you frequently use for the Perl interpreter and what do they mean?  2
What is the difference between module and package? IBM2
what r the different type of function in perl ??? Symphony1
What elements of the Perl language could you use to structure your code to allow for maximum re-use and maximum readability?  1
What?s your favorite module and why?  2
What purpose does each of the following serve: -w, strict, - T ?  2
what is the difference between require and use in perl? IBM3
 
For more CGI Perl Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com