in reply to Undefined regexp objects?
And Devel::Peek help us in another way:use overload; print overload::StrVal(qr/asdf/); # Regexp=SCALAR(...)
yielding:use Devel::Peek; Dump(qr/asdf/);
showing us that regexes are magical. I don't see it being defined anywhere. But I have no idea why this is the case. But I can't say I'd expect a sane dereference value for a magical object. :) In fact, thinking about it I'd more expect undef than anything else because... the value isn't defined since it's not actually a scalar, and what would be a good substitute value anyway?SV = RV(0x1af1fd8) at 0x1b0f118 REFCNT = 1 FLAGS = (PADBUSY,PADMY,ROK) RV = 0x1b0f190 SV = PVMG(0x1c2c5ac) at 0x1b0f190 REFCNT = 1 FLAGS = (OBJECT,RMG) IV = 0 NV = 0 PV = 0 MAGIC = 0x1af012c MG_VIRTUAL = 0x2808c138 MG_TYPE = 'r' MG_OBJ = 0x1b0b51c STASH = 0x1de7570 "Regexp"
|
|---|