CGI Perl Question: Download Questions PDF
Write a script to reverse a string without using Perls built in function?
Answer:
my $i;
my $str="hello";
my @str=split('',$str);
for($i=$#str;$i>=0;$i--)
{
print $str[$i];
}
my $str="hello";
my @str=split('',$str);
for($i=$#str;$i>=0;$i--)
{
print $str[$i];
}
Download CGI Perl Interview Questions And Answers
PDF