---
title: "stab_val(stab)->str_nok = 1; /* what a wonderful hack! */ — Larry Wall Quote #243 | QuotesBy.net"
description: "stab_val(stab)->str_nok = 1; /* what a wonderful hack! */ — a quote by Larry Wall."
image: "https://quotesby.net/wp-content/themes/quotesby-editorial/assets/og-default.png"
---

> # stab\_val(stab)-&gt;str\_nok = 1; /\* what a wonderful hack! \*/

[Larry Wall](https://quotesby.net/Larry-Wall)\#243

[Programming](https://quotesby.net/Larry-Wall/programming/)[Perl](https://quotesby.net/Larry-Wall/perl/)[Coding](https://quotesby.net/Larry-Wall/coding/)[Debugging](https://quotesby.net/Larry-Wall/debugging/)

[WhatsApp (opens in a new tab)](https://wa.me/?text=%E2%80%9Cstab_val%28stab%29-%3Estr_nok%20%3D%201%3B%20%2F%2A%20what%20a%20wonderful%20hack%21%20%2A%2F%E2%80%9D%20%E2%80%94%20Larry%20Wall%20https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F243%2F)[X (opens in a new tab)](https://twitter.com/intent/tweet?text=%E2%80%9Cstab_val%28stab%29-%3Estr_nok%20%3D%201%3B%20%2F%2A%20what%20a%20wonderful%20hack%21%20%2A%2F%E2%80%9D%20%E2%80%94%20Larry%20Wall&url=https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F243%2F)[Facebook (opens in a new tab)](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F243%2F)

## About this quote

What does it mean?The code sets a flag indicating a string is valid, with a tongue‑in‑cheek comment about the hack.In plain termsIt marks the string as ok, joking about how clever the trick is.What can you take from it?Use flags to track string validity, but be aware of hacky shortcuts.

### Where it applies

- debugging
- optimizing legacy code

### Putting it to work

- add comments
- use clear flag names

### Questions to consider

- Is the hack worth the readability cost?
- How could this be expressed more clearly?

### Another view

Such hacks can obscure intent and cause maintenance issues.

## More from Larry Wall

1. > /\* And you'll never guess what the dog had \*/ /\* in its mouth... \*/

[Permalink to quote \#241](https://quotesby.net/Larry-Wall/241/ "Permalink to quote 241")
2. > str-&gt;str\_pok \|= SP\_FBM; /\* deep magic \*/ s = (unsigned char\*)(str-&gt;str\_ptr); /\* deeper magic \*/

[Permalink to quote \#246](https://quotesby.net/Larry-Wall/246/ "Permalink to quote 246")
3. > echo 'Hmmm...you don't have Berkeley networking in libc.a...' echo 'but the Wollongong group seems to have hacked it in.

[Permalink to quote \#248](https://quotesby.net/Larry-Wall/248/ "Permalink to quote 248")

## Related quotes

1. > In general, if you think something isn't in Perl, try it out, because it usually is. :-)

[Larry Wall](https://quotesby.net/Larry-Wall)[Larry Wall quote \#33](https://quotesby.net/Larry-Wall/33/ "Permalink to quote 33")
2. > Perl has a long tradition of working around compilers.

[Larry Wall](https://quotesby.net/Larry-Wall)[Larry Wall quote \#95](https://quotesby.net/Larry-Wall/95/ "Permalink to quote 95")
3. > My programming language was solder.

[Terry Pratchett](https://quotesby.net/Terry-Pratchett)[Terry Pratchett quote \#2](https://quotesby.net/Terry-Pratchett/2/ "Permalink to quote 2")

```json
{
    "@context": "https://schema.org",
    "@type": "Quotation",
    "text": "stab_val(stab)->str_nok = 1; /* what a wonderful hack! */",
    "url": "https://quotesby.net/Larry-Wall/243/",
    "spokenByCharacter": {
        "@type": "Person",
        "name": "Larry Wall"
    }
}
{
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    "itemListElement": [
        {
            "@type": "ListItem",
            "position": 1,
            "name": "Home",
            "item": "https://quotesby.net/"
        },
        {
            "@type": "ListItem",
            "position": 2,
            "name": "Authors",
            "item": "https://quotesby.net/authors/"
        },
        {
            "@type": "ListItem",
            "position": 3,
            "name": "Larry Wall",
            "item": "https://quotesby.net/Larry-Wall"
        },
        {
            "@type": "ListItem",
            "position": 4,
            "name": "Quote #243",
            "item": "https://quotesby.net/Larry-Wall/243/"
        }
    ]
}
```
