why don't you simpy create your "in" subroutine?
sub in { my($inQuestion)= shift; foreach (@_) { return 1 if $_ eq $inQuestion; } return false; }
Okay... It looks somewhat different, but it's shorter
in($question, "a", "b", "c");

OTOH: If it's really a fixed set of allowed values, I'd go for a regex or hash (depending on the nature of the problem) too.

  1. if it's just the question, whether or not it's in a set of values, I'd take the regex approach like
    if ($day =~ /^(?:Mo|Tu|We|Th|Fr|Sa|Su)$/) ...
  2. if the options are also used to switch, what's done later, I'd prefer the hash way:
    if (defined $mnth= $monthNum{$month}) ...

$\=~s;s*.*;q^|D9JYJ^^qq^\//\\\///^;ex;print

In reply to Re: Too much SQL not enough perl by Skeeve
in thread Too much SQL not enough perl by jcpunk

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.