I was wondering if anyone knew of any existing code that knows how to compile a regular expression properly in perl 5.8.5 I cribbed this together but it Isn't working. PMOP pm; /* grr */ pm.op_pmdynflags= SvUTF8(pat) ? PMdf_CMP_UTF8 : 0; pm.op_pmflags= flags; SV *sv= newSVpv("",0); re= CALLREGCOMP(aTHX_ (char *)pat,(char *)(pat+len),&pm); sv_magic(sv, (SV*)re, PERL_MAGIC_qr, 0, 0); ret= newRV_noinc(sv); Basically I want to do the same thing that a qr// operator would do, but bypassing the normal op for it. I will note that in more modern perls it is easy to do, but in older ones I'm a little foxed. Yves -- perl -Mre=debug -e "/just|another|perl|hacker/"Thread Next