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 / uma from sswdept - hov service

$strin = "uma";
print "\n \$strin <$strin>";

$len = length($strin);
@arr = split(//,$strin);
print "\n \$len $len \@arr <@arr>";

for($i=$len-1;$i>=0;$i--)
{
print $arr[$i];
$retVal .= join(//,$arr[$i]);
print "\n retVal <$retVal> ";
}

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can inheritance be used in perl? Explain with the help of an example.

991


How will you open a file in a write-only mode in perl?

953


What does next statement do in perl?

993


Elaborate on perl bite-wise operators.

913


What does localtime() do in perl?

1006


How do I sort a hash by the hash key?

920


Write syntax to use grep function?

971


Explain chomp?

927


What is subroutine in perl?

948


What is the use of -t?

972


In CPAN module, name an instance you use.

961


We all know private variables exist in perl. But do private METHODS exist in perl ? Eg ?

2478


What are the different ways to run cgi?

960


What are the functions that can be performed using cgi program?

934


Mention how many ways you can express string in Perl?

1014