|more useful options|
I don't think there is any mystery here. Although the regexes are originally within single quotes and therefor not interpolated, in the eval they are being concatenated with the rest of the sub statement. The eval see's it just as a string. When the interpreter tries to evaluate the combined string the final delimiter of the match is escaped, hence the error, Search pattern not terminated.
It get's into the if statement ok, but its when its concatenated prior to evaluation where the problem arises.
That's why using m!! cures the problem.
I'll add... I think, cos I'm not great with regexes.
Cor! Like yer ring! ... HALO dammit! ... 'Ave it yer way! Hal-lo, Mister la-de-da. ... Like yer ring!
In reply to Re: Re: Re: A Regex to identify Regex's / Compiling a regex