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
What is the use of now constructor in perl?
What is the easiest way to download the contents of a URL with Perl?
What is the purpose of goto expr statement?
Write syntax to use grep function?
what is the function of Return Value?
What is the different between array and hash in perl programming?
What is warn function in perl?
how to get back up from private character editor which is saved in the format of .udf
What is cpan ? What are the modules coming under this?
Write a cgi program to show the header part?
What is cpan in perl?
What are the features of perl language?
What is goto statement in perl?
Which operator in perl is used for the concatenation of two strings?
What is -> symbol in perl?