• naeap@sopuli.xyz
    link
    fedilink
    arrow-up
    4
    ·
    10 hours 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…

  • aMockTie@piefed.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    11 hours 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
      8
      ·
      11 hours 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
        2
        ·
        4 hours 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.