This is my code:
print "\nThis program accepts a 9 character string from you the user a +nd determines whether or not It is a palindrome, printing the result to the screen. \n"; print "\nPlease Enter in a 9 character item: "; ; my ($a, $b, $c, $d, $e, $f, $g, $h, $i); chomp ($a=<>); chomp ($b=<>); chomp ($c=<>); chomp ($d=<>); chomp ($e=<>); chomp ($f=<>); chomp ($g=<>); chomp ($h=<>); chomp ($i= +<>); if ($a eq $i && $b eq $h && $c eq $g && $d eq $f && $e eq $e ){ print "PALINDROME!\n"; } else{ print "NOT A PALINDROME! \n"; }

I have to enter the number individually, I am trying to find a way to enter the 9 numbers all at once.

But in this case I have to enter one number and press enter on and on till I reach the 9th number.

Please can anyone help me to figure out a way to input the number in this format.

Print" please enter 9 number: \n"

123456789

Not Palindrome.

or Print" please enter 9 number: \n"

123454321

Palindrome

In my case I have to enter:

1

2

3

4

5

6

7

8

9

Not Palindrome.

I dont want it to be this way. Please I will apreciate any help.


In reply to Perl Palindrome by hushbaby

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.