rockmountain has asked for the wisdom of the Perl Monks concerning the following question:
Second program which doesn't execute#!/usr/bin/perl # Palindrome.pl $x=<STDIN>; chomp($x); $y=reverse($x); if($x eq $y) { print "Palindrome"; }
#!/usr/bin/perl # Palindrome.pl if((chomp($x=<STDIN>)) eq ($y=reverse($x))) { print "Palindrome"; }#not showing appropriate result. also I am not able watch the express +ion $x and $y in debug mode.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: why the 2nd program doesn't work?
by matija (Priest) on Apr 20, 2004 at 12:16 UTC | |
by rockmountain (Sexton) on Apr 21, 2004 at 05:00 UTC | |
by matija (Priest) on Apr 21, 2004 at 05:45 UTC | |
|
Re: why the 2nd program doesn't work?
by perlinux (Deacon) on Apr 20, 2004 at 12:32 UTC |