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 / arukumar g m

my $string="hello";
my $str;
my $i = length($string);
while($i>0) {
my $nthstr = substr($string, $i-1, 1);
$str.=$nthstr;
$i = $i-1;
}
print $str;

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define dynamic scoping.

864


What is goto statement in perl?

922


How do I pass a command line argument in perl?

953


How can I implement the function overloading in Perl ? I read about the operator overloading, I do not know how to implement the function overloading. Thanks in advance ?

2887


What $! In perl?

946


Differentiate between c++ and perl.

988


What are the different types of perl operators?

1047


what are the two ways to get private values inside a subroutine or block?

912


package MYCALC; use Exporter; our @EXPORT = (); our @ISA = qw(Exporter); our @EXPORT_OK = qw(addition multi); our %EXPORT_TAGS = (DEFAULT => [qw(&addition)],Both => [qw(&addition & +multi)]); sub addition { return $_[0] + $_[1]; } sub multi { return $_[0] * $_[1]; } 1; Program: use strict; use warnings; my @list = qw (2 2); use Module qw(:DEFAULT); print addition(@list),"\n"; Above coding is my module MYCALC and the program which using this module, I have not exported any function using @EXPORT, but I have used the DEFAULT in %EXPORT_TAGS with the function addition, when I call this function from the main it says the error as,

2659


You want to read command-line arguements with perl. How would you do that?

879


“Perl regular expressions match the longest string possible”. What is the name of this match?

925


What can be done for efficient parameter passing in perl? Explain.

995


How we can navigate the xml documents?

983


Differentiate between arrays and list in perl.

976


How do I generate a list of all .html files in a directory?

930