The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
REGEXP *       T_RX_OBJ

INPUT

T_RX_OBJ
        if (SvROK($arg)) {
            int type = SvTYPE(SvRV($arg));
            if (type == SVt_REGEXP || type == SVt_PVMG) {
                $var = ($type)SvRV($arg);
            }
            else
                croak(\"ref to $var is of type %d, not a reference to REGEXP\", type);
        }
        else
              croak(\"$var is of type %d, not a reference to REGEXP\", SvTYPE($arg));