Dear Monks,

I need to extract substrings delimited by balanced parentheses, and I installed Regexp::Common to see what it could do. Here is a test program that embeds an example from the doc (https://metacpan.org/pod/Regexp::Common).

#!/usr/bin/env perl use v5.36; use Regexp::Common; while (<>) { /$RE{num}{real}/ and print q{a number}; /$RE{quoted}/ and print q{a ['"`] quoted string}; m[$RE{delimited}{-delim=>'/'}] and print q{a /.../ sequence}; /$RE{balanced}{-parens=>'()'}/ and print q{balanced parentheses}; /$RE{profanity}/ and print q{a #*@%-ing word}; }
Unfortunately, it won't compile:
Multidimensional hash lookup is disabled at /Users/chap/private/perl/r +egcommon line 8, near "'/'}"
It seems that, at some point, it was permissible to write $foo{$bar, $frog}, which was understood by Perl to mean $foo{"$bar$;$frog"}, but this was later disabled (perl 5.33?). And I assume that {-delim=>'/'} is what's triggering the error, with '=>' being a fat comma.

Is Regexp::Common out of date? None of the 28 open issues seems to address this condition. Is there a way to make it work under v5.36 and beyond? Is there a successor to Regexp::Common?

(Incidentally, it seems from searching for "perl multidimensional hash" that most people take this to mean simply chaining keys, a la $thing{$x}{$y}{$z}, which of course is alive and well, as opposed to forming a "composite key" as in $thing{$x, $y, $z}).

Update 1: replaced literals with variables in examples of multidimensional hash lookups, per jwkrahn's comment below.


In reply to Regexp::Common and "multidimensional hash lookup disabled" (v5.36+) by ibm1620

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.