I think you need to think about this problem again before trying to solve it. You ask for one persons age, are you assuming that everyone in the group is the same age?

Your interface seems flawed to me. Rather than enter each individuals age (which you don't do at the moment, so how can you possibly be charging the correct price?) why not simply prompt for how many kids, adults and over 60s there are, you'd then know the total number of people and the entry price, at which point if there are >= 6 people apply the discount.

Now on to your code. You should read about chomping your input. If you're new to perl see:

If you have any other problems let us know. Please don't ignore formatting advice given when composing posts. See How do I post a question effectively? and Writeup Formatting Tips.


In reply to Re: Perl Programming help required by marto
in thread Perl Programming help required by Anonymous Monk

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.