in reply to Re: String matching idea
in thread String matching idea

Please indulge my curiosity - what do you consider "the obvious thing" ?

Replies are listed 'Best First'.
Re^3: String matching idea
by salva (Canon) on Sep 19, 2015 at 07:06 UTC
    Oh, well, I meant doing the obvious thing in C (or any other low-level enough language): comparing the characters one by one sequentially until a divergence is found.

    If you limit the solution to Perl, as it doesn't provide some builtin that could do that, we go into the land of tricks, as the solution posted by choroba above.