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
Explain strftime() function in perl?
What is eval function in perl?
What is perl unshift array function?
What happens in dereferencing?
Explain the meaning of closure in perl.
Demonstrate subroutines in perl with a simple example.
How to read a single line from a file in perl?
How will you open a file in a write-only mode in perl?
How can information be put into hashes?
What is the function of virtual documents in cgi programs?
What are the various file operations in perl. Explain with example.
Write a program to show the process of spawning a child process
What are the arguments and what do they mean in perl programming?
How to determine strings length in perl?
Which functions in Perl allows you to include a module file or a module and what is the difference between them?