From: Blackstone, J. D. <jda...@ci...> - 2002-08-05 14:05:43
|
> -----Original Message----- > From: Roland Giersig [mailto:RGi...@cp...] > Sent: Sunday, August 04, 2002 3:50 PM > To: Austin Schutz > Cc: exp...@li... > Subject: Re: [Expectperl-discuss] quotes around $scalar > > > >>Hmm, I offhand don't know a means to find out if a given > scalar already > >>contains a precompiled regexp. If such a check is > available I'd surely > >>implement it to make expect() even more DWIMmish in that > regard, making > >>sure that a precompiled regexp wouldn't be handled with a > substr match... > >> > >>Anybody got an idea? > >> > >> > > > > $foo = qr /stuff/; > > print ref($foo); > > > > prints "Regexp". Is that what you mean? > > > *smack* > > Ugh, yes, and I was looking into Scalar::Util and thought > about digging > into perl internas and write some .xs code... > > Looks like it's time to add some more DWIM to Expect... I just remembered something significant, something you're not going to want to hear. I think the return value of ref for a precompiled regex changed at some point for consistency. Hmmm... digging through old perldeltas ... I don't see it. Maybe I just dreamed it. Or maybe they were just talking about it. At any rate, a test with 5.00502 seems to yield the same results as 5.8.0, so never mind. (But be wary in case they jump up and change it some day.) jdb |