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
How would you replace a char in string and how do you store 
the number of replacements? 
 Question Submitted By :: Nimy
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How would you replace a char in string and how do you store the number of replacements?
Answer
# 1
$str='Hello';
$cnt= ($str=~s/l/i/g);
print $cnt;

$cnt stores the number of replacements.
 
Is This Answer Correct ?    2 Yes 2 No
Tanu
 
  Re: How would you replace a char in string and how do you store the number of replacements?
Answer
# 2
#!usr/bin/perl
use strict;
use warnings;
my $string="XmanXseriesx";
my $count = ($string =~ tr/X//);
print "There are $count Xs in the string\n";
print $string;
 
Is This Answer Correct ?    0 Yes 0 No
Ananth_s
 
 
 

 
 
 
Other CGI Perl Interview Questions
 
  Question Asked @ Answers
 
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
When would you not use Perl for a project?  1
What is the difference between for & foreach, exec & system? Photon3
What purpose does each of the following serve: -w, strict, - T ?  2
Name an instance where you used a CPAN module? TCS3
Write a script for 'count the no.of digits using regular expressions in perl.. AppLabs4
Why do you program in Perl?  1
How would you replace a char in string and how do you store the number of replacements?  2
What?s your favorite module and why?  1
what r the different type of function in perl ??? Symphony1
How can you create an object of a class in a package? IBM2
What arguments do you frequently use for the Perl interpreter and what do they mean?  1
What is the difference between module and package? IBM1
i have a folder called 'error' and in that, i have error log files which are generated by the build, now i want to findout the string 'error' from each log file and that error has to be copied into the another file called 'analysis'. how do you do this in perl? HP4
How do you open a file for writing?  4
how to search a unique pattern in a file by using perl hash map function ??? plz answer me  2
What does the command "use strict" do and why should you use it? TCS2
Explain the difference between use and require?  2
what is the procedure to define a user define module in your perl application? IBM1
How would you trap error occurred in the perl program/file? IBM2
 
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