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 importance of perl warnings? How do you turn them on?
What does undef function in perl?
How many ways can we express string in Perl?
How we can navigate the xml documents?
What are the features of perl language?
How to add elements in a hash in perl?
Why -w argument is used with perl programs?
What is the use of now constructor in perl?
What are arrays in perl?
How can you use Perl warnings and what is the importance to use them?
Explain the internal working of cgi
How many types of variable in perl?
What does the qq{ } operator do?
Explain the meaning of closure in perl.
What does `$result = f() .. g()' really return?