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
What is the purpose of goto expr statement?
Where do we require ‘chomp’ and what does it mean?
Explain the functioning of conditional structures in perl.
How does polymorphism work in perl? Give an example.
Create a function that is only available inside the scope where it is defined ?
Why should I use the -w argument with my Perl programs?
What is perl push array function?
Elaborate on perl bite-wise operators.
What is perl pop array function?
How many types of variable in perl?
How to sort arrays in perl?
Which guidelines by Perl modules must be followed?
What $! In perl?
What is the purpose of redo statement?
What is use of ‘->’ symbol?