My training was in linguistics, as well as computer science, so I've tried to make a language that works on a deep level, like human languages work. You don't have to know the whole language to use it usefully, you can do baby talk, you can do grown up talk, you can cuss in it, you can write poetry, you can be a playwright, is sort of the idea. — Larry Wall bigthink ![]()
In my experience, the post-modern movement has mostly been about not getting hung up on one particular idea or way of doing things, like modernism tends to do, and instead, sort of picking and choosing from different historical eras—I'm thinking more of architecture, where you can see different architectural features that the architect has used.
Perl is very similar in the way it has collected features from other languages, things that seem to be distinct ways of doing things and finding a way of meshing those in a pleasing fashion—the same way a poet might take words that are very different from each other and mesh them into a coherent poem. Perl, in that sense, is very, very much, it doesn't have an agenda and it really is not trying to tell you how you're supposed to do your job, it just tries to get out of your way as much as possible.
YOUTUBE ju1IMxGSuNE
Why Perl Is Like a Human Language (5m), BigThink youtube ![]()
Perl is much more like a natural language than most computer languages. Human languages tend to be much more ambiguous than computer languages because humans are are much smarter about interpreting the context. There is a scale of how much a computer language resembles human language primarily based on how much context is involved.
.
Ruby extended this notion of a operating context within a computer language. I think that is why there was such a proliferation of domain-specific languages written in ruby. Yehuda Katz explained Metaprogramming in Ruby: It's All About the Self. blog ![]()
Some perl idoms that reveal it's approach to context:
$_ @_ perl -lane 's/foo/bar/g && print'
The -lane follows an older unix idiom that lets command-line flags be combined rather than separated. Then -n itself changes the context for the interpreter to wrap the -e expression in a loop that iterates over STDIN.
The bare substitution s/foo/bar/ operates on the implicit $_ variable which holds the current line in the iteration from STDIN.
The success or failure of the substitution is treated as a boolean. When combined with && it says "do the next thing if the previous thing worked."
And print is also assuming you meant to print $_.
All of that is to say that perl does different things depending on the context. Larry Wall did that to purposefully make the language behave like natural language.
.
Compare Boulder Vernacular Architecture