Write a script to reverse a string without using Perl's
built in function
Answer Posted / vipul dalwala
#!/usr/bin/perl
my $str = "hello";
$revstr = "";
while($str =~ /(.)/g)
{
$revstr = $1.$revstr;
}
print $revstr."\n";
Is This Answer Correct ? | 12 Yes | 2 No |
Post New Answer View All Answers
explain the various functions/directives in perl that allow you to include/import a module. Also, state the differences between them.
Explain what is the scalar data and scalar variables in Perl?
What does a die() function do in perl?
How to turn on Perl warnings? Why is that important?
Show the use of sockets for the server and client side of a conversation?
Explain subroutine in perl?
What are perl strings?
What is goto statement in perl?
Explain chop?
What is an interpolation in perl?
Explain grooving and shortening of arrays and splicing of arrays?
Explain the different types of data perl can handle.
Write a program that explains the symbolic table clearly.
Give an example of using the -n and -p option.
What are stdin, stdout and stderr?