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

Answer Posted / venkatesh

#!/usr/bin/perl
$a = "Venky";
@c;
@b = split("", $a);
foreach $char (@b){
unshift(@c, $char);
}
$value = join("", @c);
print "$value\n";

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

496


How to copy a file in perl?

510


What does localtime() do in perl?

561


How to concatenate strings in perl?

588


When do you use perl programming?

587






Hi, I am a accountant. I am preparing a balance sheet but because of staff shortage and time pressures I cant complete it on time. There is lot of common data with last years which I need not retype and I can manage by editing last year’s balance sheet ? Is their any software on net where I can do this easily??

1754


You want to print the contents of an entire array. How would you do that?

521


Does Perl have reference type?

523


What are the functions that can be performed using cgi program?

483


Explain returning values from subroutines?

532


Is perl a case sensitive language?

634


what is the difference between java and cgi?

557


Explain goto label?

509


What are the steps involved when the cgi program starts running?

504


What does length(%HASH) produce if you have thirty-seven random keys in a newly created hash?

572