Write a script to reverse a string without using Perl's
built in function
Answer Posted / kiran pawar
my $string = "kiran";
my @name = split//,$string;
while(@name){
print pop @name;
}
| Is This Answer Correct ? | 9 Yes | 1 No |
Post New Answer View All Answers
If you want to empty an array then how would you do that?
How do I sort a hash by the hash key?
What is the importance of perl warnings? How do you turn them on?
What are the advantages of c over Perl?
What is the purpose of redo statement?
package MYCALC; use Exporter; our @EXPORT = (); our @ISA = qw(Exporter); our @EXPORT_OK = qw(addition multi); our %EXPORT_TAGS = (DEFAULT => [qw(&addition)],Both => [qw(&addition & +multi)]); sub addition { return $_[0] + $_[1]; } sub multi { return $_[0] * $_[1]; } 1; Program: use strict; use warnings; my @list = qw (2 2); use Module qw(:DEFAULT); print addition(@list),"\n"; Above coding is my module MYCALC and the program which using this module, I have not exported any function using @EXPORT, but I have used the DEFAULT in %EXPORT_TAGS with the function addition, when I call this function from the main it says the error as,
What are the different string manipulation operators in perl?
What are the arguments and what do they mean in perl programming?
You want to concatenate strings with perl. How would you do that?
What is goto statement in perl?
Explain what is lvalue?
what is Chop & Chomp function does?
What does cgi program store?
What is an interpolation in perl?
How to create a directory in perl?