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

G'day ibm1620,

"Is there a way to make it work under v5.36 and beyond?"

A tedious fix in all of your scripts so that they work today:

use v5.36; use feature 'multidimensional'; use Regexp::Common;

Update: What follows turned out to be incorrect information. This is explained in "Re^2: Regexp::Common and "multidimensional hash lookup disabled"". I have stricken the remainder of the original post but retained it in the spoiler.

— Ken

Replies are listed 'Best First'.
Re^2: Regexp::Common and "multidimensional hash lookup disabled"
by LanX (Saint) on Jul 02, 2023 at 15:07 UTC
    Hi Ken

    > permanent fix would be a bug report providing a patch that adds this statement near the start of Regexp::Common:

    > use if $] >= 5.035, feature => 'multidimensional';

    I doubt that's possible, because the problem happens outside the scope of that module, i.e. when using and calling it.

    I think your "test code" is misleading, because the feature is activated for the remaining lexical scope, not the package alone.

    Can't check till tomorrow tho...

    Cheers Rolf
    (addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
    Wikisyntax for the Monastery

        Sorry, stressy client (for the time being) and health issues don't leave me with much time. I even had to cancel my trip to Toronto.

        Cheers Rolf
        (addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
        Wikisyntax for the Monastery

Re^2: Regexp::Common and "multidimensional hash lookup disabled"
by kcott (Archbishop) on Jul 10, 2023 at 13:33 UTC

    In "Re: Regexp::Common and "multidimensional hash lookup disabled"", I suggested that a patch for Regexp::Common could fix the problem. This was wrong.

    The "source for Regexp::Common" starts with (line 3):

    use 5.10.0;

    This will use the feature bundle :5.10. See "feature: FEATURE BUNDLES" which includes:

    :5.10 bareword_filehandles indirect multidimensional say state switch

    So, the multidimensional feature is already loaded.

    My test included:

    ... package Regexp::Common; use if $] >= 5.035, feature => 'multidimensional'; package main; ...

    which seemed to fix the problem. However, rewriting that as:

    ... package Regexp::Common { use if $] >= 5.035, feature => 'multidimensional'; } package main; ...

    and the problem returns:

    Multidimensional hash lookup is disabled at ...

    I'll be striking the incorrect information from the earlier post. It will be in a spoiler; I won't delete it.

    — Ken

Re^2: Regexp::Common and "multidimensional hash lookup disabled"
by ibm1620 (Hermit) on Jul 03, 2023 at 22:14 UTC
    Thanks, Ken.

    What I couldn't understand was how Regexp::Common's tests were succeeding during installation, and when I invoked them standalone. Finally realized it was because the test scripts didn't have use v5.36; at the top!

    My use of Regexp::Common should be rare enough that I can live with writing use feature 'multidimensional'; when I need to. It sounds like adding it to the module may be tricky. Too bad it'll take a bit of digging for others to discover, although searching for the error now turns up this thread as google's first hit. :-)