Greetings fellow monks,

Thanks so much for the help you've already given me.
Now I'm learning how to use the elsif conditional.
My script is producing the following error:

Your script produced this error: syntax error
at ./elsif.cgi line 7, near ") &&"

Thanks for taking the time to read this post.
I look forward to reading your response.
require TripodCGI; $CGI=new TripodCGI; $firstName=$CGI->param('firstName'); $Age=$CGI->param('Age'); print "Content-type: text/html\n\n"; print "<HTML><TITLE>Conditionals test</TITLE> </HEAD><BODY>"; if ($Age < 13) && ($Age > 0)) { print "What are you doing here, $firstName? This Web site is strictly PG-13. Shame on you for being so naughty as to come here!"; } elsif ($Age < 18) && ($Age > 12)) { print "Not to long ago, we’d have have chased you away from our Web site. But now that you’re a teenager and mature enough for PG-13 materials, we’re glad to see you $firstName."; } elsif ($Age < 30) && ($Age > 17)) { print "If you’re viewing this Web site on your work computer, you should be aware that the materials presented on this Web site are, in their own way, as inflammatory as pornography. You could get in a lot of trouble, $firstName."; } elsif ($Age < 40) && ($Age > 29)) { print "Congratulations, $firstName, you’re on longer a callow youth. Never trust anyone under 30; that’s what we say!"; } elsif ($Age < 60) && ($Age > 39)) { print "You’re getting on in years, $firstName. It’s time to start thinking about establishing retirement savings."; } else { print "So you’re still dirt poor, $firstName? Oh well, guess you always will be. Those are the breaks, oldster."; } print "</BODY></HTML>";

In reply to A newbie's first try at conditionals by Nihil Angst

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.