in reply to Troubles with m!(??{substr(...)})!

Without trying to sound facetious... Why would you want to do a thing like that?

I can't figure out the purpose. It seems to me as if you are taking a leading substring from a string, and then seeing if you match the substring in the string. Which you always will, unless the substring happens to contain meta-characters which will be interpreted differently by the regexp engine.

So if that is the case, why don't you just see whether

substr($test, 0, $_) eq quotemeta(substr($test), 0, $_))

Of course, I may be overlooking something obvious, so feel free to clue me in.


print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'