• PumaStoleMyBluff@lemmy.world
      link
      fedilink
      arrow-up
      10
      ·
      10 days ago

      Probably because showing your email regex publicly is a great way to get 1000 messages about obscure edge cases you’re not handling 😛

  • aMockTie@piefed.world
    link
    fedilink
    English
    arrow-up
    9
    ·
    10 days ago

    Why waste time doing any matching if wantarray == false? Just do:

    if(!wantarray) { return 1; }

    Before any matching happens, or if you only want one return statement set the value of a variable in if(!wantarray)/elsif(regex) and return that variable at the end.

    • marcos@lemmy.world
      link
      fedilink
      arrow-up
      11
      ·
      10 days ago

      That Perl. You never know if return doesn’t have some kind of hidden behavior that uses the local variables…

      Well, you could read the perldoc page on it. But you can’t just assume it.

      • jjj@piefed.blahaj.zone
        link
        fedilink
        English
        arrow-up
        6
        ·
        10 days ago

        Counterargument: ctrl+f is a great place for regex. Write once read never problems are a great application for unreadable languages. Imagine if people wrote scripts in the language vi uses for editnig<escape>bceediting, which mostly isn’t even displayed as it’s typed! <escape>

        But yeah, it’s kind of terrible for anything else.

  • naeap@sopuli.xyz
    link
    fedilink
    arrow-up
    5
    ·
    10 days ago

    At least the cat is happy again now after getting adopted

    I’ll forever be sad trying to understand the regex I’ve written myself…

    • spicy pancake@lemmy.zip
      link
      fedilink
      English
      arrow-up
      2
      ·
      10 days ago

      similarly, cats don’t usually express emotions with their face (and often don’t express them at all)