Skip to content
quotesby

About this quote

What does it mean?
The code sets a flag on a string and then casts its pointer, describing both steps as 'deep magic'.
In plain terms
It marks the string and then treats its data as raw bytes, calling it magic.
What can you take from it?
Be explicit when manipulating low‑level string internals to avoid obscure code.

Where it applies

  • performance‑critical code
  • interfacing C with higher‑level languages

Putting it to work

  • document intent
  • use safer abstractions

Questions to consider

  • What does the flag actually change?
  • Can this be replaced with a clearer API?

Another view

Calling it magic hides the real purpose and can be error‑prone.

More from Larry Wall

  1. 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
  2. echo 'ICK, NOTHING WORKED!!! You may have to diddle the includes.';;

    Permalink to quote #249
  3. echo $package has manual pages available in source form. echo 'However, you don't have nroff, so they're probably useless to you.

    Permalink to quote #250

Related quotes

  1. Well, I think Perl should run faster than C. :-)

    Larry WallLarry Wall quote #181
  2. Perl should remain fast and intuitive (to the extent that it is :-)

    Larry WallLarry Wall quote #187
  3. Will the people in the cheaper seats clap your hands? And the rest of you, if you'll just rattle your jewelry.

    John LennonJohn Lennon quote #1