How would you replace a char in string and how do you store
the number of replacements?
Answer Posted / ananth_s
#!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 ? | 7 Yes | 1 No |
Post New Answer View All Answers
What does the’$_’ symbol mean?
Which functions in Perl allows you to include a module file or a module and what is the difference between them?
What is the function of virtual documents in cgi programs?
What is the easiest way to download the contents of a URL with Perl?
Perl uses single or double quotes to surround a zero or more characters. Are the single(' ') or double quotes (" ") identical?
what are the strategies followed for multiple form interaction in cgi programs?
“The methods defined in the parent class will always override the methods defined in the base class”. What does this statement means?
How to connect with sqlserver from perl and how to display database table info?
There are two types of eval statements i.e. Eval expr and eval block. Explain them.
What is subroutine in perl?
What does last statement do in perl?
How to read file into hash array ?
What is the difference between use and require in perl?
Elaborate on perl bite-wise operators.
What are prefix dereferencer?