---
title: "str->str_pok |= SP_FBM; /* deep magic */ s = (unsigned char*)(str->st… — Larry Wall Quote #246 | QuotesBy.net"
description: "str->str_pok |= SP_FBM; /* deep magic */ s = (unsigned char*)(str->str_ptr); /* deeper magic */ — a quote by Larry Wall."
image: "https://quotesby.net/wp-content/themes/quotesby-editorial/assets/og-default.png"
---

> # str-&gt;str\_pok \|= SP\_FBM; /\* deep magic \*/ s = (unsigned char\*)(str-&gt;str\_ptr); /\* deeper magic \*/

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

[Perl](https://quotesby.net/Larry-Wall/perl/)[Performance](https://quotesby.net/Larry-Wall/performance/)[Code comment](https://quotesby.net/Larry-Wall/code-comment/)

[WhatsApp (opens in a new tab)](https://wa.me/?text=%E2%80%9Cstr-%3Estr_pok%20%7C%3D%20SP_FBM%3B%20%2F%2A%20deep%20magic%20%2A%2F%20s%20%3D%20%28unsigned%20char%2A%29%28str-%3Estr_ptr%29%3B%20%2F%2A%20deeper%20magic%20%2A%2F%E2%80%9D%20%E2%80%94%20Larry%20Wall%20https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F246%2F)[X (opens in a new tab)](https://twitter.com/intent/tweet?text=%E2%80%9Cstr-%3Estr_pok%20%7C%3D%20SP_FBM%3B%20%2F%2A%20deep%20magic%20%2A%2F%20s%20%3D%20%28unsigned%20char%2A%29%28str-%3Estr_ptr%29%3B%20%2F%2A%20deeper%20magic%20%2A%2F%E2%80%9D%20%E2%80%94%20Larry%20Wall&url=https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F246%2F)[Facebook (opens in a new tab)](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F246%2F)

## 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 termsIt 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](https://quotesby.net/Larry-Wall/248/ "Permalink to quote 248")
2. > echo 'ICK, NOTHING WORKED!!! You may have to diddle the includes.';;

[Permalink to quote \#249](https://quotesby.net/Larry-Wall/249/ "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](https://quotesby.net/Larry-Wall/250/ "Permalink to quote 250")

## Related quotes

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

[Larry Wall](https://quotesby.net/Larry-Wall)[Larry Wall quote \#181](https://quotesby.net/Larry-Wall/181/ "Permalink to quote 181")
2. > Perl should remain fast and intuitive (to the extent that it is :-)

[Larry Wall](https://quotesby.net/Larry-Wall)[Larry Wall quote \#187](https://quotesby.net/Larry-Wall/187/ "Permalink to 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 Lennon](https://quotesby.net/John-Lennon)[John Lennon quote \#1](https://quotesby.net/John-Lennon/1/ "Permalink to quote 1")

```json
{
    "@context": "https://schema.org",
    "@type": "Quotation",
    "text": "str->str_pok |= SP_FBM; /* deep magic */ s = (unsigned char*)(str->str_ptr); /* deeper magic */",
    "url": "https://quotesby.net/Larry-Wall/246/",
    "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 #246",
            "item": "https://quotesby.net/Larry-Wall/246/"
        }
    ]
}
```
