Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a script to reverse a string without using Perl's
built in function

Answer Posted / vipul dalwala

#!/usr/bin/perl

my $str = "hello";
$revstr = "";

while($str =~ /(.)/g)
{
$revstr = $1.$revstr;
}

print $revstr."\n";

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of goto expr statement?

858


Where do we require ‘chomp’ and what does it mean?

934


Explain the functioning of conditional structures in perl.

897


How does polymorphism work in perl? Give an example.

827


Create a function that is only available inside the scope where it is defined ?

968


Why should I use the -w argument with my Perl programs?

930


What is perl push array function?

905


Elaborate on perl bite-wise operators.

866


What is perl pop array function?

898


How many types of variable in perl?

1023


How to sort arrays in perl?

975


Which guidelines by Perl modules must be followed?

979


What $! In perl?

921


What is the purpose of redo statement?

973


What is use of ‘->’ symbol?

962