this post was submitted on 28 Sep 2026
127 points (99.2% liked)

Programmer Humor

33371 readers
695 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS
 
top 7 comments
sorted by: hot top controversial new old
[–] sit@lemmy.dbzer0.com 1 points 1 minute ago

Doggy is not smiling but trying to lose heat. Doggy is the real regular expression

[–] rockSlayer@lemmy.blahaj.zone 1 points 8 minutes ago
[–] Aatube@lemmy.dbzer0.com 4 points 47 minutes ago

none of the meat of the regex shown, 0/10

[–] akunohana@piefed.blahaj.zone 13 points 1 hour ago
[–] aMockTie@piefed.world 6 points 1 hour ago* (last edited 1 hour ago) (1 children)

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 3 points 45 minutes 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.

[–] death_to_carrots@feddit.org 1 points 1 hour ago

If regular expressions are your solution, than your problem is wrong.