I prefer to use indenting to make all the parens more clear. Also, this "unless not" syntax can be confusing.
I think I got this right, but it is easy to make a mistake. Consider:
# X is the "default action"
# do X with an exception that when A,B and C are all false
# then don't do X
unless (!A and !B and !C) {X}
# if anybody is true then they all can't be false
# so we do X unless anybody is true (meaning they
# can't all be false)
unless (A or B or C) {X}
-------
unless ( (!($args =~ /\-rs(\s+)(\S+)/)) &&
(!($args =~ /\-p(\s+)(\S+)/)) &&
(!($args =~ /\-P(\s+)(\S+)/)) )
{.....
# I figure this is easier to understand:
unless ( $args =~ /\-rs(\s+)(\S+)/ or
$args =~ /\-p(\s+)(\S+)/ or
$args =~ /\-P(\s+)(\S+)/ )
{....
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.