---
title: "Dan Smith: I've tried (in vi) 'g/[a-z] [a-z]/s//_/'...but that doesn'… — Larry Wall Quote #16 | QuotesBy.net"
description: "Dan Smith: I've tried (in vi) 'g/[a-z] [a-z]/s//_/'...but that doesn't cut it. Any ideas? (I take it that it may be a two-pass sort of solution). Lar… — a quote by Larry Wall."
image: "https://quotesby.net/wp-content/themes/quotesby-editorial/assets/og-default.png"
---

> # Dan Smith: I've tried (in vi) 'g/\[a-z\] \[a-z\]/s//\_/'...but that doesn't cut it. Any ideas? (I take it that it may be a two-pass sort of solution). Larry Wall: In the first pass, install perl. :-)

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

[Perl](https://quotesby.net/Larry-Wall/perl/)[Choice](https://quotesby.net/Larry-Wall/choice/)[Solution](https://quotesby.net/Larry-Wall/solution/)[Scripting](https://quotesby.net/Larry-Wall/scripting/)

[WhatsApp (opens in a new tab)](https://wa.me/?text=%E2%80%9CDan%20Smith%3A%20I%27ve%20tried%20%28in%20vi%29%20%27g%2F%5Ba-z%5D%20%5Ba-z%5D%2Fs%2F%2F_%2F%27...but%20that%20doesn%27t%20cut%20it.%20Any%20ideas%3F%20%28I%20take%20it%20that%20it%20may%20be%20a%20two-pass%20sort%20of%20solution%29.%20Larry%20Wall%3A%20In%20the%20first%20pass%2C%20install%20perl.%20%3A-%29%E2%80%9D%20%E2%80%94%20Larry%20Wall%20https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F16%2F)[X (opens in a new tab)](https://twitter.com/intent/tweet?text=%E2%80%9CDan%20Smith%3A%20I%27ve%20tried%20%28in%20vi%29%20%27g%2F%5Ba-z%5D%20%5Ba-z%5D%2Fs%2F%2F_%2F%27...but%20that%20doesn%27t%20cut%20it.%20Any%20ideas%3F%20%28I%20take%20it%20that%20it%20may%20be%20a%20two-pass%20sort%20of%20solution%29.%20Larry%20Wall%3A%20In%20the%20first%20pass%2C%20install%20perl.%20%3A-%29%E2%80%9D%20%E2%80%94%20Larry%20Wall&url=https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F16%2F)[Facebook (opens in a new tab)](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F16%2F)

## About this quote

What does it mean?Wall jokes that installing Perl is the first step to solving a vi sorting problem, implying Perl’s power.In plain termsInstall Perl first to solve the problem.What can you take from it?Leverage the right tool for the job.

### Where it applies

- text processing
- script automation

### Putting it to work

- use Perl for regex
- choose appropriate language

### Questions to consider

- When should you switch tools?
- What are the trade‑offs of using Perl?

### Another view

Perl may not always be the best fit for every task.

## More from Larry Wall

1. > It won't be covered in the book. The source code has to be useful for something, after all... :-)

[Permalink to quote \#15](https://quotesby.net/Larry-Wall/15/ "Permalink to quote 15")
2. > Let's say the docs present a simplified view of reality... :-)

[Permalink to quote \#17](https://quotesby.net/Larry-Wall/17/ "Permalink to quote 17")
3. > It's documented in The Book, somewhere...

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

## Related quotes

1. > Randal said it would be tough to do in sed. He didn't say he didn't understand sed. Randal understands sed quite well. Which is why he uses Perl. :-)

[Larry Wall](https://quotesby.net/Larry-Wall)[Larry Wall quote \#20](https://quotesby.net/Larry-Wall/20/ "Permalink to quote 20")
2. > : But for some things, Perl just isn't the optimal choice. (yet) :-)

[Larry Wall](https://quotesby.net/Larry-Wall)[Larry Wall quote \#69](https://quotesby.net/Larry-Wall/69/ "Permalink to quote 69")
3. > Do what you feel in your heart to be right - for you'll be criticized anyway. You'll be 'damned if you do, and damned if you don't.'

[Eleanor Roosevelt](https://quotesby.net/Eleanor-Roosevelt)[Eleanor Roosevelt quote \#1](https://quotesby.net/Eleanor-Roosevelt/1/ "Permalink to quote 1")

```json
{
    "@context": "https://schema.org",
    "@type": "Quotation",
    "text": "Dan Smith: I've tried (in vi) 'g/[a-z] [a-z]/s//_/'...but that doesn't cut it. Any ideas? (I take it that it may be a two-pass sort of solution). Larry Wall: In the first pass, install perl. :-)",
    "url": "https://quotesby.net/Larry-Wall/16/",
    "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 #16",
            "item": "https://quotesby.net/Larry-Wall/16/"
        }
    ]
}
```
