I tried "m//" as reported on your 'next' expression and got 'd e f g h', as expected. From my perlop on 5.36.

    The empty pattern "//"
            If the *PATTERN* evaluates to the empty string, the last
            *successfully* matched regular expression is used instead. In
            this case, only the "g" and "c" flags on the empty pattern are
            honored; the other flags are taken from the original pattern. If
            no match has previously succeeded, this will (silently) act
            instead as a genuine empty pattern (which will always match).

            Note that it's possible to confuse Perl into thinking "//" (the
            empty regex) is really "//" (the defined-or operator). Perl is
            usually pretty good about this, but some pathological cases
            might trigger this, such as "$x///" (is that "($x) / (//)" or
            "$x // /"?) and "print $fh //" ("print $fh(//" or
            "print($fh //"?). In all of these examples, Perl will assume you
            meant defined-or. If you meant the empty regex, just use
            parentheses or spaces to disambiguate, or even prefix the empty
            regex with an "m" (so "//" becomes "m//").

In reply to Re^3: Empty pattern in regex by perlboy_emeritus
in thread Empty pattern in regex by choroba

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.