Hello Monks! I am new to perl and have a question. I am trying to make a palindrome program for class. Our teacher wants us to use chop but I am a little lost. Do I need to join the @userinput array? I tried doing that but everytime I run the program it says palindrome not my else statement.
any help is appreciated
my (@userinput, $user, $a, $b, $c, $d, $e, $f, $g, $h, $i);
print "\nThis program asks for you to \n
enter any nine character sequence and \n
then tells you if it is a palidrome!\n\n";
print "Please enter your sequence ";
($user = <>);
$a = chop ($user);
$b = chop ($user);
$c = chop ($user);
$d = chop ($user);
$e = chop ($user);
$f = chop ($user);
$g = chop ($user);
$h = chop ($user);
$i = chop ($user);
@userinput = ($i, $h, $g, $f, $e, $d, $c, $b, $a)
if ($user = @userinput)
{
print "PALIDROME!";
}
else
{
print "NOT A PALIDROME!";
}