![]() |
|
Syntactic Confectionery Delight | |
PerlMonks |
Regexp::Common and "multidimensional hash lookup disabled" (v5.36+)by ibm1620 (Hermit) |
on Jul 01, 2023 at 22:37 UTC ( [id://11153245]=perlquestion: print w/replies, xml ) | Need Help?? |
ibm1620 has asked for the wisdom of the Perl Monks concerning the following question:
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). Unfortunately, it won't compile: 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.
Back to
Seekers of Perl Wisdom
|
|