p5pclub / ref-util

Ref::Util - Utility functions for checking references
6 stars 11 forks source link

VSTRING, LVALUE and REGEXP refs #32

Open Hugmeir opened 7 years ago

Hugmeir commented 7 years ago

VSTRING: \v1 LVALUE: \substr("abc", 1, 1) REGEXP: \${qr/abc/}

INVLIST is normally unreachable, so seems like a good idea to just kept that unimplemented. (there are some INVLISTs inside the interpreter, but no way to access them without XS: perl -E 'use Inline C => q< SV* gimme_invlist() { return newRV_inc(PL_GCB_invlist); } >; say gimme_invlist()' )

Since I'm at it -- Ref::Util doesn't compile on 5.8. I guess that's intended, but if 5.8 support is ever on the table, here's a thing to watch out for: perl -MDevel::Peek -le 'sub BM () { "foo" }; { my $x = index "foo", BM }; print ref \BM; Dump(BM)' \BM is a SCALAR ref, but BM is actually a PVBM, instead of a PVMG like in newer perls.

(note: I edited this ticket to include REGEXP too, forgot to add that before!)

xsawyerx commented 7 years ago

@Hugmeir 5.8 should be supported. We're trying to support this back to 5.6 (just for kicks, to be honest). It is resolved in #29.

xsawyerx commented 6 years ago

5.8 and 5.6 are supported again. Regexes are also supported.