stab_val(stab)->str_nok = 1; /* what a wonderful hack! */
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 terms
- It 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
Putting it to work
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
/* And you'll never guess what the dog had */ /* in its mouth... */
Permalink to quote #241 str->str_pok |= SP_FBM; /* deep magic */ s = (unsigned char*)(str->str_ptr); /* deeper magic */
Permalink to quote #246 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
Related quotes
In general, if you think something isn't in Perl, try it out, because it usually is. :-)
Larry WallLarry Wall quote #33 Perl has a long tradition of working around compilers.
Larry WallLarry Wall quote #95 My programming language was solder.
Terry PratchettTerry Pratchett quote #2