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 happens in dereferencing?
Define dynamic scoping.
how to extract pin_code,phone_number,year from text file using regular expressions in perl
Where do we require ‘chomp’ and what does it mean?
Explain goto name?
Does Perl have objects? If yes, then does it force you to use objects? If no, then why?
How do you you check the return code of a command in perl?
what is the function of Return Value?
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??
Write an example explaining the use of symbol tables.
what is Chop & Chomp function does?
Why does Perl not have overloaded functions?
Explain subroutine?
Suppose an array contains @arraycontent=(‘ab’, ‘cd’, ‘ef’, ‘gh’). How to print all the contents of the given array?
what is CPAN?