in reply to Re: string containing characters
in thread string containing characters

Note: Possibly ok, but doesn't handle duplicates in @list.

Replies are listed 'Best First'.
Re^3: string containing characters
by hippo (Archbishop) on Jan 22, 2025 at 09:35 UTC

    Handle how? If you try it with my @list = qw/? ? ? s s s a a a y y y/; instead, it works equally well. Not as efficiently, I grant you but it doesn't croak or give the wrong result.


    🦛

      It gives the wrong result. That list will match your first string even though it doesn't have three ?.

      But again, it's possible that duplicates are disallowed, but the OP did not say they were disallowed.

        I see what you mean now - thanks. IvanH has obviously been very loose in the spec. We'll see if he comes back with something more well-defined.


        🦛