Try this!!!!
#!\\C:\\Perl\\bin\\perl -w my $name=<STDIN>; chomp($name); @arr=split(//,$name); $count=@arr; $num=0; #print $count; for ($i=0;$i<$count;$i++){ if ($arr[$i] eq $arr[$count-1]){ #print "$arr[$i] ===== $arr[$count]\n"; $count--; }else{ $num++; last; } } if ($num == 0){ print "Word is polindrome!!!"; }else{ print "Word is not a Polindrome!!!"; }
In reply to Re: Palindrome Program without Reverse function
by kranthi_votary
in thread Palindrome Program without Reverse function
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |