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
Explain regular expression in perl?
How to add elements in a hash in perl?
Write a program to decode the data in the form using cgi programming
What are the reasons that cookie server can’t handle multiple connections?
Perl regular expressions are greedy" what does this mean?
Explain lists ?
what is the function that is used to identify how many characters are there in a string?
If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR} and *{"Foo::".EXPR}?
What are the various perl data types based on the context?
How to remove a directory in perl?
What are perl array functions?
How to connect with sqlserver from perl and how to display database table info?
Write a program to concatenate the $firststring and $secondstring and result of these strings should be separated by a single space.
What is qq (double q)operator in perl?
You want to add two arrays together. How would you do that?