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


Please Help Members By Posting Answers For Below Questions

Explain regular expression in perl?

527


How to add elements in a hash in perl?

510


Write a program to decode the data in the form using cgi programming

541


What are the reasons that cookie server can’t handle multiple connections?

531


Perl regular expressions are greedy" what does this mean?

499






Explain lists ?

524


what is the function that is used to identify how many characters are there in a string?

535


If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR} and *{"Foo::".EXPR}?

508


What are the various perl data types based on the context?

535


How to remove a directory in perl?

484


What are perl array functions?

525


How to connect with sqlserver from perl and how to display database table info?

530


Write a program to concatenate the $firststring and $secondstring and result of these strings should be separated by a single space.

628


What is qq (double q)operator in perl?

551


You want to add two arrays together. How would you do that?

480