Write a script to reverse a string without using Perl's
built in function
Answer Posted / pallavi w
#!/usr/bin/perl -w
2
3 use strict;
4 my $string = "STRING";
5 my $rev_string = join "", reverse (split ("", $string));
6
7 print "The String is ". $string ."\n";
8 print "The reverse string is ". $rev_string ."\n";
| Is This Answer Correct ? | 4 Yes | 8 No |
Post New Answer View All Answers
How to read a single line from a file in perl?
Explain about the applications of perl?
What exactly is grooving and shortening of the array?
What does file test operators do in perl?
Remove the duplicate data from @array=(“perl”,”php”,”perl”,”asp”)
How to concatenate strings in perl?
How interpreter is used in perl?
How to read file into hash array ?
Can inheritance be used in perl?
List the data types that Perl can handle?
You want to concatenate strings with perl. How would you do that?
How to determine strings length in perl?
What is perl push array function?
Comment on array slicing and range operator
what are the three groups involved in information sharing?