Looks to me like the first candidate is a !~~ operator (or maybe a change to the behaviour table of ~~). Due to all the magic in the ~~ operator, $a !~~ $b is (well would not be) not the same thing as !($a ~~ $b). Let's have a look at what does the ~~ mean in case $a is an array and $b is a regexp:

@ARGV ~~ /\.mdb$/i
What does that mean? Is it true if ANY of the elements in the array match the regexp or if ALL match? According to the docs @ARRAY ~~ $regexp is equivalent to grep /$regexp/, @ARRAY. Which means that statement above is true if ANY of the parameters matches the regexp (ends with .mdb).

Ok, but how do I make sure all are? How do we rewrite:

if (grep { not /\.mdb$/i } @ARGV) { print STDERR "All parameters must be MDB files\n"; exit; }
with the cool new ~~ if
@ARGV ~~ /\.mdb\z/ or die "All parameters must be MDB files"
doesn't cut it? And
@ARGV ~~ sub {$_[0] !~ /\.mdb$/i} and die "All parameters must be MDB files"
according to the docs doesn't work? (According to the docs @ARRAY ~~ $sub is $sub->(@ARRAY) not grep {$sub->($_)} @ARRAY)

With !~~ it would be easy:

@ARGV !~~ /\.mdb$/i and die "All parameters must be MDB files";

And

given($foo) { when (! /some regexp/) {...} ... }
or maybe
given($foo) { when ! (/some regexp/) {...} ... }
would also come in handy.


In reply to What's missing in Perl 5.10 by Jenda

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.