Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: How can I tell if an object is based on a regex?by demerphq (Chancellor) |
on Jun 01, 2007 at 17:12 UTC ( [id://618803]=note: print w/replies, xml ) | Need Help?? |
Long ago i had this question, and the general answer was as chromatic replied, so i wrote the code that diotalevi points out, first in Data::Dump::Streamer and later moved it to re.pm in core. However the latter is only in the blead perl version and is not yet available in a production release of Perl. Had chromatic not vetoed my UNIVERSAL::DOES patch it would have been possible to do UNIVERSAL::DOES($rx,'qr//') but he elected to make said function/method essentially useless in the name of OO purity instead. Sad but true. Such is life in open source. :-(
--- $world=~s/war/peace/g
In Section
Seekers of Perl Wisdom
|
|