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
Write an example explaining the use of symbol tables.
You want to add two arrays together. How would you do that?
Explain ivalue?
how to connect cisco switch uisng perl script
What can be done for efficient parameter passing in perl? Explain.
We all know private variables exist in perl. But do private METHODS exist in perl ? Eg ?
Which feature of perl provides code reusability?
Explain what is lvalue?
What is -> symbol in perl?
What are the logical operators used for small scale operations?
what is the main function of fork() in cgi programming?
How can I display all array element in which each element will display on next line in perl ?
What is perl programming?
Explain gmtime() function in perl?
Create a function that is only available inside the scope where it is defined ?