Write a script to reverse a string without using Perl's
built in function
Answer Posted / uma from sswdept - hov service
$strin = "uma";
print "\n \$strin <$strin>";
$len = length($strin);
@arr = split(//,$strin);
print "\n \$len $len \@arr <@arr>";
for($i=$len-1;$i>=0;$i--)
{
print $arr[$i];
$retVal .= join(//,$arr[$i]);
print "\n retVal <$retVal> ";
}
Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
How to close a directory in perl?
Explain about typeglobs?
What is the use of –w?
what is the main function of fork() in cgi programming?
You want to connect to sql server through perl. How would you do that?
Which functions in perl allows you to include a module file. State their differences.
What is perl push array function?
Can inheritance be used in perl? Explain with the help of an example.
What is stdin in perl?
How to implement a stack in Perl?
What is the function of cgiwrap in cgi programming?
how to extract pin_code,phone_number,year from text file using regular expressions in perl
How to connect with sqlserver from perl and how to display database table info?
You want to download the contents of a url with perl. How would you do that?
Explain arrays in perl.