Since your syntax is a little off (as tilly pointed out), I'm not exactly sure what you're asking.  Looking at the interpretations by the others above me, I'm even less sure of what you want.  But, let me point out some simple and obvious things since you are as you say, new to Perl and to this site.

You may not have figured this out yet, but the Perl Monks site has very good tutorials.  If you look in the Tutorial section of this site, in particular the pages on if statements and unless statements, you should find your answers pretty quickly.

After reviewing these two tutorial pages you will be better equiped to ask a more detailed of a question, using the syntax and layout presented in the tutorials.

Incidentally, I hope my comments don't sound condescending.  They are not meant to be.  I'm still pretty new to Perl myself and have figured out the two basic things I'm mentioning here:  the tutorials are helpful, and one can get good feedback from the monks when one is specific and when one asks questions using the vocabulary and common points of reference.


In reply to Re: if and unless by Spenser
in thread if and unless 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.