Write a script to reverse a string without using Perl's
built in function

Answer Posted / kiruthikau

my $i;
my $str="hello";
my @str=split('',$str);
for($i=$#str;$i>=0;$i--)
{

print $str[$i];
}

Is This Answer Correct ?    47 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you use Perl warnings and what is the importance to use them?

533


Explain goto label, goto name, and goto expr?

550


Explain the difference between "my" and "local" variable scope declarations. ?

561


What are the arguments and what do they mean in perl programming?

519


Explain the execution of a program in perl.

500






What is the importance of perl warnings?

533


How do find the length of an array?

518


What is the difference between die and exit in perl?

563


Which functions in perl allows you to include a module file. State their differences.

524


How does a “grep” function perform?

595


Explain the default scope of variables in perl?

510


Is there any way to add two arrays together?

568


What is -> symbol in perl?

566


What is perl pop array function?

532


Why -w argument is used with perl programs?

552