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
How to connect to SQL server through Perl?
What are the steps involved when the cgi program starts running?
How do you find the length of an array?
Define operators used in perl?
How to copy a file in perl?
What does read () command do?
When does circular reference occur?
Which statement has an initialization, condition check and increment expressions in its body? Write a syntax to use that statement.
What is the function of cgiwrap in cgi programming?
How to read a file into a hash array?
Suppose an array contains @arraycontent=(‘ab’, ‘cd’, ‘ef’, ‘gh’). How to print all the contents of the given array?
Explain the internal working of cgi
What are perl strings?
In Perl, there are some arguments that are used frequently. What are that arguments and what do they mean?
how to connect cisco switch uisng perl script