Slashdot Mirror


The Slashdot Interview With Larry Wall

You asked, he answered!

Perl creator Larry Wall has responded to questions submitted by Slashdot readers. Read on for his answers... What's your computer set-up look like
by LichtSpektren

Can you give us a glimpse into what your main work computer looks like? What's the hardware and OS, your preferred editor and browser, and any crucial software you want to give a shout-out to?

LW: For the last year or two, I've been using a four-core Lenovo X1 Carbon2 (provided by my employer, craigslist, who hired me to be their "Artist in Residence" (and are still hiring, though not for that position)). Apart from a wonky keyboard layout and a capacitive strip that's close to useless, it's been pretty much ideal for my development, communication, and presentation needs. I'm running Linux Mint on it (Cinnamon, if you care, or even if you don't care, like me).

As for editor, I've used lots of them, so I have no strong religious feelings. I hacked on Goslings emacs when I was younger (and in fact the regex package in very early Perl was "borrowed" from there, before we switched to Henry Spencer's regex engine). But I started getting an arthritic pinky finger from emacs, so I switched to vi, and by the time vim came out my neurons were pretty much wired up to that way of thinking.

I run firefox on Linux, and chrome on my ancient Google phone, but I'm not a browser wonk. Maybe I'll have more opinions on that after our JS backend is done for Perl 6...

We've used lots of tools, of course, but certainly we couldn't have got Perl 6 done as fast^Wsoon as we did without irc or git.

Flying Cars
by WorBlux

Given that every other famous Larry in tech seems to be starting their own secret flying car factory, when are you going to start yours?

LW: If I told you, it wouldn't be a secret anymore, now would it?

Actually, I have a little cash flow problem, insofar as I was too efficient: I gave away all my billions in advance directly, rather than via my bank account. Most philanthropists get that way by screwing you over when they're younger, then becoming more generous as they get older. I guess I'll just have to do it the other way around.

How can we get PERL into the browser?
by Proudrooster

Larry, PERL is a great language, the swiss-army chain saw.

My question is, how can we strategically pull the PERL language into the browser? Javascript and PHP are getting all the browser action. We know that Embperl and Mod_perl exist for server side scripting, but how can we can PERL into the browser? Do you have friends at Google/Apple/Firefox?


LW: Our rakudo compiler for Perl 6 was designed to have multiple backends. Currently we support both MoarVM and JVM, but others are planned. In particular, a Javascript backend is already underway, and has progressed to the stage of being bootstrapped in NQP (that is, "Not Quite Perl", the restricted subset of Perl 6 that rakudo itself is written in), so the JS backend is most of the way to being able to compile and run the full rakudo compiler, and once it can do that, most of the rest of Perl 6 is already written in Perl 6, so someday in the not-so-distant future you'll be able to compile and run Perl 6 anywhere you can run Javascript.

At some point, the Nativecall library will also be ported, which gives full access to pretty much any C shared library, as well as embedded Perl 5, Python, or what have you, as well as their associated libraries. (Of course, sandboxing might get in the way of that in a browser, not to mention you can't rely on what the user has or hasn't installed on the client anyway.)

By the way, the MoarVM backend uses libuv, so our semantics should not be very far from what Node.js supports.

All that being said, getting mindshare is a slow process unless you're willing to overpromise, which we try not to do. We do get excited about the fundamental strengths of our design in FP, OO, concurrency, Unicode, and so on, but over the short term that translates mostly to acceleration, which only later leads to velocity. For a computer language that is meant to last decades, we're more interested in steady growth without artificial barriers. Of course, we won't mind at all if this generation of hipsters decides to use Perl 6, but we're not really interested in joining the Flavor of the Month club. If you look at our butterfly mascot, you'll see we're thinking generationally. Camelia is designed to impress 7-year-old girls more than 47-year-old alpha geeks, and generally succeeds at that. :-)

Why isn't PERL more windows friendly
by goombah99

My pet theory of why Perl has lost favor to Python is that it's really a Unix language. You can run it on a Windows box but only with a lot of effort to install and to maintain it. It seems to me that Perl could be more successful if one could get it adopted intrinsically into the Windows environment. A common, mistaken, lament about Perl is all the sigils that make it look like swearing. But those actually add meaning (I can tell what's an array, a reference, a glob, or a scalar) and they are familiar to bash users. But one can see how windows users aren't steeped in this so Perl gets a bad rap.

If Microsoft were to distribute an app that ran a Perl shell with all the first class privileges their own shells have Perl would be widely adopted as a superior do-it-all administration language.

Thoughts?


LW: Well, my spies inside Microsoft tell me that Perl is actually used quite heavily internally, so maybe I haven't been beating my wife quite so much as the question would indicate. :-)

It's true that Perl came from a Unix heritage, so there's a bit of impedance mismatch with some of the more Unix-flavored builtins, at least up through Perl 5. Perl 6 is much more OS-agnostic, both in design and in community support, insofar as a number of our developers work on Windows or OS X in addition to Linux. Indeed, our chief architect, Jonathan Worthington, develops primarily on Windows.

We already had an independent, proof-of-concept implementation of Perl 6 on the CLR (niecza) which worked pretty well, so as soon as someone gets the gumption to implement a CLR backend for rakudo, I suspect we'll fit back into the Microsoft toolbox about as well as C# does.

That being said, Perl has never been designed to be primarily an interactive shell. We do have a much better REPL in Perl 6 than Perl 5 has, though.

As for the success of Python relative to Perl, it's not so much either Windows or sigils. Some people do seem to develop an allergic reaction to the sigils, it's true. And that will continue, since we've regularized and powered up the sigils in Perl 6, so they're pulling even more weight than in Perl 5.

But I think the success of Python has mostly to do with being light enough in its OO model that it could move into some ecological niches more quickly than the Perl 5 design could. Perl has always considered itself primarily a programmer-centric language, while Python has always considered itself to be more institution-centric. So in a sense it's a bit dumbed down, much like Java. You'll note both of those languages make their greatest appeal to managers. :-)

Also, Python has done pretty well as a first programming language, even if the design runs out of steam at certain points. In contrast, we tend to think of Perl (especially Perl 6) more as a last programming language, the language of choice for people who need a language that won't give up when the going gets tough.

Perl in the embedded world
by mykepredko

HI Larry

What has been done to port Perl to very small devices as a tool to create test applications? I'm doing some control work right now and testing/characterizing devices and peripherals with the results generating a set of csv data on the console that is copy and pasted into Excel.

I am really asking about small 32bit devices (with floating point units) - Cortex M4 specifically. I don't think a port could be created for an 8bit processor like the AVR.

Thanx!


LW: Several things to say about that. We're already 32-bit capable, if "already" is the correct term for being so retro. (For a given architecture, you might have to make sure you can emulate 64-bit integers with a pair of 32s, since we guarantee 64-bit denominators for our rationals.)

Second, we can already compile and run Perl 6 on a Raspberry Pi, though of course it takes hours for Perl 6 to compile itself, since we don't have a jit for that CPU, so everything is interpreted.

Third, since the normal way of bootstrapping a new backend is via cross-compilation, we already have mechanisms in place for that, so if a given device is not big enough to support the whole compiler compiling itself (which needs a gig or so of memory), but it can support the runtime, we could do cross-compilation to the device and then download a program with runtime support into it.

Not saying we support this out of the box right now for any random architecture, but as with our philosophy on a lot of requested features, we try to make sure we just get close enough to it that someone sufficiently motivated could take it the final step pretty easily.

Language Design
by columbus

Hi Larry, Thank you for your contributions to the field of Computer Science.

My question is: in your opinion, what are the most important things to consider when designing a new computer language?


LW: Everything.

Seriously, if you're not designing a DSL (Domain Specific Language), then you're designing a general purpose language, and your only choices are to force the world to fit into your chosen paradigm, or try to support multiple paradigms. We much prefer the multi-paradigm approach. It turns out if you accept the 90% of each paradigm that is practical, and reject the 10% that puritanically rejects other paradigms, you can get a pretty decent general-purpose language out of it (see Perl 6).

But no matter how much of "everything" you take into account, you're still going to get blindsided, and you're still going to discover lots of ways you could have made better tradeoffs. There's no such thing as a perfect language, really. We used maybe 50 or 60 competing design principles in the design of Perl 6, but the most important one is: "There is no single most important design principle, including this one."

Or to put it the other way around, if you focus on only a few important things, your language will be good only for those few important things you focus on. Which is okay, if that's the goal you want to have. But there's a long history of people confusing "general-purpose" with "Turing-complete".

Intellectual Property
by ytene

As the recently re-trial of the case brought by Oracle against Google (over use of Java structures in Android) shows, intellectual property is and will remain hot property. One of the interesting things about intellectual property and languages, however, is how much of the syntax of supposedly different languages is remarkably similar (with a lot of inheritance from C).

May I ask for your views with respect to firstly protecting the intellectual property that you have invested in Perl as a language, but then perhaps also the wider challenge of IP with respect to programming languages and actual software packages?


LW: Well, the most fundamental protection of most open-source code is that it flies under the radar. Or to mix in a different metaphor, we tend to come up from the grassroots, and while it's possible to kill a given lawn if you try hard enough, you can never kill all the grass in the world. So as much as possible we merely try to flow around the problem. Software interprets lawyers as damage, and routes around them.

That being said, there are various ways to get more protection than mere anonymity; you may have noticed there are more strongly-held opinions about that than there are software licenses. But for myself, I'm under no illusion that I have anything like equal protection under the law. I can't afford to patent any of the many patentable ideas in Perl. That's not how software development should work, anyway. It would be a waste of my time. Along with many others, I hope copyright law, well-written licenses, and mutual-aid societies are sufficient to keep the patent trolls from starting to play whack-a-mole with us.

So I think the best thing open-source authors can do right now is to absolutely ignore existing patents, because if you happen to know you're violating a particular patent, they can whack your mole much harder. And maybe, just maybe, the courts will someday decide that we don't really want to end up with a society where multi-national corporations own everything worth owning. One can hope, and occasionally vote.

How do you perceive English predominance in the IT
by Anonymous Coward

As a linguist, you surely have some thoughts to share on the English language predominance in the IT field (as well as many others). Do you think that it may somewhat shape the way programming languages are designed, as well as IT infrastructures and ultimately our societies, in comparison of what it would be if we would use a no-nation-native language such as Esperanto?

LW: Well, sure. I suppose if Japanese had turned out to be the lingua franca of the computing world, we'd all probably have ended up using some "reverse-Polish" language like Forth or Postscript, since Japanese nearly always puts the head of any phrase at the end. I didn't know there were people who thought in reverse-Polish till I started learning Japanese.

On the other hand, we did end up with English as the lingua franca, lucky me. There's really no way to change that. My impression of Esperanto (without having learned it) is that it's still rather Euro-centric, so it would likely not appeal much to Asians. And while Lojban tries to be less, um, imperialistic, it doesn't really succeed in being a good human language. I mean, come on, mandatory positional parameters to verbs, with little rhyme or reason across different verbs? Gimme a break. A case grammar (more like named arguments) would have made much more sense.

In any case, people want to learn English anyway so they can watch movies from Hollywood, so it's a losing cause. The best we can do as English speakers is to try to be sensitive to the needs of other language groups. One thing we do to fight cultural imperialism with Perl 6 is to treat any grapheme as if it were a precomposed character, whether or not the Unicode Consortium happens to have defined one under NFC yet. If there's no precomposed codepoint, we simply make one up temporarily. So we get O(1) string indexing based on what the user thinks is their language. (Even for characters outside the BMP. Lots of current languages force you to consider an emoji or a cuneiform character as a combination of two codepoints. Yuck! I mean, XP. Well, I really mean U+1F61D, FACE WITH STUCK-OUT TONGUE AND TIGHTLY-CLOSED EYES. But you'll have to imagine it for now, because Slashdot is not written in Perl 6. (Yet.)

As far as I know, Swift is the only other major language so far that attempts to present graphemes as a native speaker of a language would understand characters. However, my understanding is that the Swift algorithm is still O(n) or so, not O(1) like Perl 6.

Beyond that, we also make virtually no ASCII or Latin-1 based decisions in Perl 6. You want Chinese characters in your identifiers, no problem. Tamil in your module names, no problem, we'll map to whatever your filesystem supports. You wanna define a new operator with a happy cat emoji, no problem. It's Unicode all the way, baby! If your client turns your ASCII quotes into smartquotes, we don't care, we just handle it. And not just English quotes, but also other common quoting styles with lowered and/or reversed quotes smartquotes. You wanna write Inf as that funny sideways 8 character, or write pi with the Greek letter, go right ahead. You wanna write your powers with superscripts instead of **, you can do that too. Yes, we're insane, but you're gonna love it...as soon as you figure out how to type it.

By the way, did you know Perligata and Babylscript?

I'm aware of both of them, but I wouldn't exactly put them into the same category. :-)

Python . . . ?
by PolygamousRanchKid

What do you think about Python . . . ?

LW: Well, alright, since you asked...

Python is a pretty okay first language, with a tendency towards style enforcement, monoculture, and group-think. Python is more interested in giving you one adequate way to do something than it is in giving you a workshop that you, the programmer, get to choose the best tool from. So it works well for certain problems that can use an existing tool, but less well for other problems that require a machine shop to make a new tool. For instance, if you only want to think of your list processings as list comprehensions, Python 3 tends to enforce that culturally. If you want several ways to map over a list depending on which order makes more sense in context, Perl 6 will be more accommodating. If you want concurrency with a global interpreter lock, Python might suit. But if you want a concurrency model designed to scale to multicore/manycore, look to Perl 6, which avoids global bottlenecks and non-composable primitives, but instead borrows composable ideas from Haskell, Go, Erlang, and C# instead.

If Python's object model matches how you want to do things, it's fine for that. If it's not, Python doesn't really provide a coherent meta-object model underneath, just a lot of hooks, which might or might not give you the flexibility you need.

Some Pythonistas claim that Python is a good functional programming language, mostly on the strength of list comprehensions, but in my estimation Python has only half-hearted FP support; it really doesn't provide the benefits of lexical scoping, closures, laziness, or higher-order programming that I'd expect in a strong FP contender, nor does it encourage you to think that way.

Finally, many of us feel that Python 3 broke backward compatibility for very little benefit. When we broke backward compatibility with Perl 6, we decided to break everything that needed breaking. It took us a bit longer -- well, okay, quite a bit longer -- but I think we'll be much happier with the end result in the long run.

In any case, I hope Perl 6 will have more staying power than Duke Nukem Forever, even if they did beat us out the door. Same with Python 3.

Perl and PHP
by hcs_$reboot

PHP got a lot of inspiration from Perl, while missing key concepts (you know this one). However, thanks to web development PHP is currently one of the most popular languages. What is your honest opinion about PHP? Are there things in PHP, missing in Perl, you regret not having thought about?

Reversely, which Perl features PHP should have taken?


LW: PHP is both the motivational poster child for worse-is-better, as well as the demotivational poster child for worse-is-worse. Somehow PHP has managed to convince a horde of programmers that if their programs are flakey or hard to maintain, it must somehow be the programmer's fault. It couldn't possibly be because they've been frog-boiled.

P.T. Barnum would love it...

(I suppose in all fairness I should point out that I have friends who have managed to put PHP to good use, but then I have a lot of weird friends, so take that for what it's worth.)

To the best of my recollection, Perl has never borrowed a PHP feature. We didn't even skip version 6, as they did.

And you really can't ask me what other languages should borrow from Perl. Well, you can, but the answer is the same for all of them. If you borrowed enough features to make a difference and arrive at a consistent solution, you'd've just reimplemented pretty much all of Perl 6. :-P

And here you thought I was a humble guy...

Doubtless future years will find plenty of ways to humble me again, but this year I'm officially proud of everything the team accomplished.

Esteemed Individuals
by JohnDeHope3

It seems like a lot of industries have "esteemed individuals" who are given the benefit of the doubt. Priests, rabbis, imams, tenured professors, elite actors and directors, etc. Maybe in technology we have people like Larry Wall, David Heinemeier Hansson, Douglas Crockford, Paul Graham, etc. What are your thoughts on this?

I like having the feeling of esteem. It warms my heart when I think about what I've learned reading Fred Brooks, Seth Godin, Donald Knuth, etc. I hold you all in revence. I don't think this is such a bad thing. Would I blindly follow whatever any you say? No, of course not. But wisdom is wisdom, and experience is experience, and those of you who have it, and have had it, and have written to me about it, are very much appreciated and held in high esteem. I think this is all very good and healthy and perfetly natural. Thank you!


LW: You're very welcome, and thanks for the encouragement!

We have all been given great gifts, and each of us must pass them on as we are able. I am okay with receiving esteem, since it's probably more beneficial to the giver than the recipient anyway. I'll only point out that I get a lot of credit for stuff other people have done too, and that's probably bad for my immortal soul. :-)

Patch and git
by waveclaw

What are your views on version control systems like git and modern development practices around them?

Early F/OSS development practices started with tarballs and patches, moved to packages and VCSes then to (a)social coding with DVCS like Mercurial or git. You've been there for most if not all of that. git can be described as a distributed content management system for patches. Linux Torvals' git --am workflow can be likened to playing chess via email but with kernel development the end game and patches as moves.


LW: As I mentioned earlier, we rely heavily on git for Perl 6 development. Certainly git requires you to think more like a functional programmer, where all your data is immutable, so if you change something, it has a different identity. Most of the design falls out from that, so once you get that into your head, the design makes much more sense. Of course, the git command set is a bit wonky in spots, but you can always write your own shell aliases...

And thank you for patch, by the way. The diff command outputs the difference between two files. You wrote the patch command to take diff output and turn one file into another, including the ability to even go backwards and undo that change later. As someone who's had to package software for a Linux distribution this is critically important tool. Patch lets me preserve the original author's work. But patch (and quilt) lets me still apply needed changes and store those changes in obvious discrete packets of standard format that are diff files.

Well, I suspect git and its ilk have largely superseded the need for patch, partly because they cover the same functionality, but mostly just because networks are so much faster. The main benefit to patch when it came out was that it allowed any collaboration at all, since back in the day nobody had the bandwidth to just keep resending the whole project over and over. The patch program provided two killer features that helped with that. First, the fuzzy matching based on context diffs that would allow you to apply patches to a program you'd since modified yourself (if your mods weren't too violent). Second, the mechanism to enforce the application of previous patchlevels, which I put in in self-defense because my attempts at supporting the first version of rn resulted in tragicomic, er, results. So the second version of rn enforced patchlevels, which kept everyone in sync sufficiently well that they could apply later patches without worrying about whether they skipped some earlier patch accidentally (or more likely, on purpose, since people were understandably lazy about hand-applying patches).

Anyway, patch did help launch the whole open source movement, and I'm content with that, even if patch itself is wandering vaguely in the direction of the sunset.

Project governance
by njahnke

Do you know of any project governance models that are 'known good' other than benevolent dictator for life? It seems to me like 'caring' is the key to project success - and the BDFL him/herself, presumably, cares a great deal and inspires others to care a great deal.

I've always wondered whether this known good level of success could be achieved with some modicum of democracy or in a project that is part of a larger project (and the project manager is appointed from above rather than self-selected). I've heard some good things about Apple's DRI or directly responsible individual, but it doesn't seem like other groups have had as much success implementing it, which makes me wonder about the method.

By the way, thank you for all your work on Perl - it has brought me great fortune.


LW: Thanks. I know some projects have been successfully democratized out to the level of a committee, but I suspect it's very difficult to democratize much beyond that, simply because most people wouldn't have time to learn enough to cast meaningful votes. Certainly the founders of the U.S. felt that way in establishing a representative republic rather than a direct democracy. It's hard enough to get people to vote as it is.

In Perl culture, I'm known as a BDFL, but I tend to emphasize the B over the D, unlike certain other BDFLs we could name. Really, though, I function much more like a supreme court than a chief executive. The irc channel functions as our congress, proposing and hashing out new ideas. But I actually delegate most of the executive and architectural decisions to other designers, and get involved mostly only when I see issues that other people don't see, or when a decision on overall direction or balance is necessary and there doesn't seem to be a reasonable consensus. I do pretty much retain dictatorial veto power, but I try to use that power as seldom as possible.

As Queen Elizabeth would say, I try to reign, not rule.

Why perl?
by Anonymous Coward

Why would you encourage someone to learn perl? (Compared to other programming languages, feel free to just give a general "reason" for perl, or an actual comparison)

LW: The main reason to learn Perl is that, since we don't enforce any particular style or approach, you don't have to switch languages when you start wanting to learn some other programming style or paradigm. We hope that Perl 6 will be especially useful to professors who want to cover industrial strength OO, FP, and concurrent programming in a single course or curriculum.

Achieving Escape Velocity From Perl 5's Gravity
by Baldrson

Perl 6 seems to offer a lot in the base language, obviating many CPAN modules, but the network-effect of CPAN modules creates a gravitational field which, in combination with the differences in the base language, makes reaching escape velocity to Perl 6 challenging.

What is the strategy for achieving escape velocity from Perl 5's orbit to Perl 6's?


LW: The strategy is anti-gravity.

You can build a platform in mid-air that is all Perl 6 on top, but can reach down to call into any existing Perl 5 infrastructure as needed. It isn't quite free of overhead, but it works pretty well, even emulating Perl 5 classes in Perl 6 and vice versa. Perl 5 XS-based modules even work (though Perl 6's Nativecall is much simpler to use). So there's no need to panic and translate everything to Perl 6 all at once. It can be an organic process over time. In general, though, we've found that many people enjoy translating their Perl 5 to Perl 6, since it gives them a chance to rethink and refactor with a new set of tools. We allow people to stop part way up our space elevator, but the view is arguably a little more spectacular at the top.

Double Question
by shaitand

As a Perl 5 programmer, why should I care about Perl 6? Perl is most used by sysadmins and Perl 5 of some sort can be found on all major *nix distributions out of the box. Without this support Perl 6 might as well not even exist for this group who already have to code for Perl versions a decade out of date in many cases. How, if at all, do you see Perl 6 resolving this problem or do you see Perl 6 hitting a different base altogether?

LW: Perl 6 is not meant to replace Perl 5, at least not in the sense that Python 3 is meant to replace Python 2. There are no plans to murder Perl 5. There is certainly some overlap in the applicability of Perl 5 and Perl 6, and Perl 6 arguably has a lot more potential long-term, so at some point in the distant future, we expect that Perl 5 will eventually run out of cultural steam. But we're decades from that point now, and if anything, the Perl 6 effort has injected a lot of new energy into Perl 5 support.

People tend to think of new versions of a language as parent and child (where the child is expected to kill its parent?!?), but nowadays we like to think of them more as older and younger sisters, with different strengths and weaknesses. There is occasionally a bit of sibling rivalry, but by and large they blend well when they sing together. And for sure, many of the Perl 6 developers still love Perl 5 for what it is, and don't want to break that.

Help me promote Perl 6
by Anonymous Coward

I'm a big fan of Perl and still use it when I can for various personal projects and have been known to introduce it in official work-related tasks (where engineers were using batch files or shell scripts, etc.). I love Perl's terseness and flexibility. I learned regex from Perl in my first development job and it has stuck with me through a dozen different languages.

However, as many others have mentioned, it is falling out of favor, and in fact there are very few development shops that even have a need or desire for it. I've looked for Perl jobs and they rarely come up. It seems that most back-ends are now being written in any number of next-gen scripting languages like Python, JavaScript (NodeJS), and Swift. I don't see the advantages of these, but it's often hard to explain to colleagues, CTOs, managers, etc. the value of Perl over the newest trends. And Perl "6" is meaningless because to everyone else it's still Perl. Why should we choose Perl 6 over the new establishment?


LW: Because it's the next generation after all those languages you mentioned.

Perl's place in the world...
by drakaa

Perl used to be central to so many things (the 'glue' language for the internet), but seems to be slowly falling out of use in deference to JavaScript, Java, Python, VBScript/PowerShell, etc. It's the language I used in my first job as a system administrator (back around the time you gave your first interview), and I loved it.

With so many years between the announcement of Perl 6 and it's completion, many people moved on to other solutions or technologies. Perl 6 is here now, but why should I use it?


LW: Because it's the next generation after all those languages you mentioned. Or maybe it's several generations beyond that, but showed up early. :-)

How to think in Perl 6
by mattr

I'd like to express my deep, unending thanks for building something that is really wonderful, Perl, and a wonderful community. I made a living with Perl, the first postmodern language of which I am aware, and derived a lot of enjoyment from TMTOWTDI, and contributed back to the community on Perl Monks at the time. It was a lot of fun to meet some of the famous, talented Perl visionaries then. I enjoy thinking in Perl and it has made me stronger.

I'd like to get into Perl 6 which having stolen all the cool stuff from the other languages appears likely to be the most advanced and artistic of all them. At the very least I look forward to being able one day to think in Perl 6.

Can you provide some examples to /. readers about why you like Perl 6, and what dimensions of awesomeness are waiting beyond Python and Javascript? I think you would be a good person to rouse a wakeup call.


LW: Well, I like Perl 6 mostly because it fits my brain. I like the way it scales up and down on abstraction levels, so you're not forced to use fancy abstractions if you don't want to, but when you do want to, they're there for you. I like that the Perl 6 parser is really a bunch of braided sublanguages that can be derived from and overridden to turn Perl 6 into whatever language I'll want 20 years from now. Probably software to automate my old-folks home...

But lessee, you want some examples, we can do examples. In fact, rather than just me inlining a bunch of them here, I'll recommend you look at sites like Rosetta Code, where you can not only see hundreds of examples of Perl 6, but also compare them to similar solutions in other languages. The Perl 6 solution will usually be one of the most concise and elegant, yet pretty darn readable, even if you don't grok all the constructs. Just as a for-example, you might run into any of various metaoperators in the examples. Say, for a factorial:

sub postfix:<!> ($n) { [*] 1..$n }
say 42!;

Even if you don't know the language, you can see that it's defining some sort of postfix operator called "!", which if you're at all familiar with math, will look like a factorial. The parameter in parens looks a lot like a parameter in many other languages. But instead of an explicit loop or recursive definition, we're doing something to what is obviously a range from 1 to $n. The prefix [*] is apparently related to the * of multiplication somehow, and maybe the [] are indicating some kind of list processing, since other parts of the program might be composing lists using []. Together with the ! hint, it's probably sufficient for you to deduce that [*] is some kind of reduce-with-multiplication operator (sometimes called a "fold" if you're coming at it from the functional programming end of things).

So you try this snippet, and find it prints:

1405006117752879898543142606244511569936384000000000

which you immediately recognize as 42 factorial. :-)

You might also be delighted that, without any extra work on your part, it didn't overflow your native integer type.

Here's another example. Suppose you see:

my @values = some-random-call();
say @values[0,2,4 ... *];

It doesn't take much brain to see that @values is some kind of plural value, probably an array, and that you're probably indexing into it, because you've already figured out that [] seems to have something to do with lists. But what the heck is that subscript? It looks exactly like, gee, the sequence of all the even numbers, up to some kind of wildcard value.

Well, that's exactly what it is, and it gives you a slice of every other value.

So go ahead, and read some of those Rosetta Code examples, even if you don't know Perl 6 yet. Only a few of them are scary, and most of those have explanations. Go ahead, I'll wait here.

That, and if you have a moment, how about a good reason or three (efficiency? creativity? extensibility? ability to suggest further growth? having lots of PhDs?) why Google should promote Perl 6 in-house and support the growth of the Perl 6 language and implementations. Perhaps sponsor completion of the Perl 6 kernel for Jupyter project? How about sponsor some people to document and make accessible free books? What are some Perl 6 initiatives that could use some eyes if not $$?

Well, if Google wants to do something like that, it's really up to them. I do know that some people inside Google are playing with Perl 6, and probably have a better idea than I do when it would be appropriate to promote Perl 6 internally. But I've seen languages rise and fall based on attempting to get corporate sponsorship, so we don't tend to emphasize the institutional end of language promotion much. (One of Perl's slogans is: "We suck at marketing.")

We mostly just need champions who have the vision to drive projects like Jupyter. And to envision them in the first place, since I'm just one guy, and a pretty senile one at that. Even without my age, I'm coming back to that peculiar place I was at with Perl 5 in the mid-90's, when I started getting the pleasant feeling that I was no longer in control, no longer able to keep up with the ferment of activity, that it was no longer possible for me to know everything about every part of the project, and that it was time for the community to be self-energizing. Perl 6 is just now starting to feel that way to me. So I could try to make up some things that need doing, but I'd probably just repeat what you already know. We already have people working hard on various forms of documentation, as well as the release and module tools, for instance.

Much as I'd like to think of Perl culture as a star topology with me at the center, it's only a little bit that way, and I'm mostly just one node in the community graph that has many interconnections I'm not aware of. And that is exactly how it should be.

Rational behind the major syntax changes in 6?
by colin_faber

Hi Larry, As a long time Perl hacker, and contributor of various modules to CPAN I'm wondering what the rational was behind the major syntax changes in Perl 6? I've read various items trying to explain it, but none so far have done a very good job. Admittedly I haven't fully grasp Perl 6 yet (mostly because it involves learning a new language I thought I knew well).

There isn't room here to explain the 15 years of reasoning and discussion that went into all the changes, but I assure you the syntax changes were all well motivated, often for multiple reasons simultaneously. But I can at least give you some examples of the principles we used in the refactor.

First, let's clear one thing out of the way. The heart of Perl is not some particular syntax, but a way of thinking about how a language works together with itself holistically. Mechanisms we use in natural languages come into play, such as metaphor and simile ("A class is just a kind of package, a method is just a kind of function."), as does the idea that your program should talk about the problem you're trying to solve, not just describe its own structure (given/when/next instead of switch/case/break). If you like the way Perl 5 works inside, I think you'll come to like the way Perl 6 works inside even better.

Now, some of those principles I promised. As I write this, I'm riding in a 767 at an altitude of 35,000 feet or so. The outside of this jet is very smooth, compared to the airplanes of 100 years ago, or even 50 years ago. There's a certain amount of drag as the plane goes through the air, but streamlining and vortex control is all about reducing the unnecessary drag on the airplane. So too, computer languages have a certain amount of complexity necessary to solve the problem, but also introduce a certain amount of unnecessary turbulence in the stream of tokens. So some of our syntax changes are just for simplification and cleanup of unnecessary complexity. Case in point: Perl 5, like many C-derived languages, requires parentheses around conditional loop arguments. Those turn out to be largely redundant in a language that requires braces around the block. So they're gone in Perl 6. As a side benefit, this makes it easier to refactor a front conditional into a back conditional, and vice versa.

The change from -> to . can also be seen as such a simplification, especially since Perl 6 is more object-oriented than Perl 5, so you tend to use more method calls. Also it simplifies the learning process for all those programmers coming from little-known languages like Java. Beyond that, when you have a simpler form like a dot, it becomes much easier to define variants of it. Perl 6 can now do things like have an assignment operator form of method call using $obj .= method or a conditional form of method call using $object.?method. Those would be much uglier if we stuck with -> for method calls.

We also changed syntax to make things more regular and consistent. You might ask why we flipped the for loop syntax around from:

for my $i (1..100) { say $i }

to

for 1..100 -> $i { say $i }

Well, the main reason is that curlies now consistently indicate closures, even in special syntax like this. (It's really a kind of lambda, if you're into Lisp and such.) So the loop body is really a closure that is called with $i as a parameter. This automatically scopes the variable to the block, where Perl 5 has to do special magic to make that work. It also automatically allows more complicated argument passing to your loop, so you can loop over multiple values at once, or unpack compound values right there in the signature if you like. The special case of "loop variable" simply doesn't exist in Perl 6. We got rid of oodles of special cases by a few simple syntactic tweaks. In fact, notice how you could use the same closure to write the loop other ways:

(1..100).map: -> $i { say $i }# method style
map -> $i { say $i }, 1..100; # function style

Likewise, a simple block using $_ as its single argument is merely a handy way to write a single-argument closure with a self-declaring argument.

As another example, there's no longer a list of special functions that magically take the topic as an argument. Instead, you just call a method without specifying the object, and it defaults to the topic. So you see things like a bare .say in Perl 6 where you'd see a bare say in Perl 5. But don't have to remember that "say" takes an implicit topic anymore. Another special case gone.

Another driver of syntax change is disambiguation of confusingly overloaded terms. In Perl 5, "package" might indicate a package, or a module, or a class. In Perl 6, those are now separate keywords. They are still packages, but we put the metaphor in at a semantic level rather than the syntactic level. Likewise for subroutines vs methods.

Perl 5 also has a lot of things that are defined operationally through setting magic variables like @ISA. In Perl 6, we tend to use actual declarations instead. They still run code underneath to take care of the operational aspects of the declaration, but the ducts and wires are hidden now unless you take down the ceiling tiles. So modifications to declarations are generally done by applying traits, not by tweaking magic variables.

Of course, Perl has always tried to make easy things easy, and hard things possible. In the syntactic realm we often call this "Huffman coding", in metaphorical honor of Huffman's compression code that assigns smaller numbers of bits to more common bytes. In terms of syntax, it simply means that commonly used things should be shorter, but you shouldn't waste short sequences on less common constructs. One example of this is the ternary operator:

$maybe ? "yes" : "no"# Perl 5 (and C etc.)
$maybe ?? "yes" !! "no" # Perl 6

Here we decided that the ternary operator was just not common enough to waste two very useful characters on. So we demoted it to using doubled question and exclamation marks. This has the added benefit of being more consistent with all the other short circuiting (thunk-based) operators such as && and ||. We picked !! instead of :: because the latter can be confused with package separators, and because consistently throughout Perl 6, ? is associated with testing for truth, while ! is associated with testing for falsehood. (Indeed, instead of writing !!$x to test for truth, you can now just write ?$x.)

Similarly, many things that were easy or hard to write in conventional regex notations now trade around in difficulty. We got tired of writing (?:a|b|c) for simple grouping and "huffmanized" that down to [a|b|c]. But that forces us to "dehuffmanize" [a-z] to something longer, which is fine, because [a-z] is not even correct for Latin-1, let alone all of Unicode. So you have to choose now: either you righteously write <:lower> or <:Ll> to get any lowercase Unicode letter, or if you really, really want an enumerated character class of only ASCII letters, you add angle brackets (which we also stole for metasyntax), to get <[a..z]> instead. Notice all ranges now are indicated with .. consistently. But because we dehuffmanized the notation, we can also fix the negation of a character class to be out-of-band; instead of poking ^ in with the characters, we put a minus outside: <-[a..z]>. (In fact, this notation now extends to set operations on character classes, so we come out ahead. Amazing things happen when you abandon insane syntax.)

These kinds of decisions are repeated over and over in Perl 6, both inside and outside of regex, particularly in places where early Perl slavishly followed inconsistent Unix or C traditions without question, merely to gain initial acceptance. It was time to reinvent all those traditions and replace them with a more consistent and readable notation. The concepts are largely the same though, once you get the hang of it.

Finally, some syntax policy changes are driven by the need for future extensibility. We're a bit stricter in our whitespace rules now, primarily to distinguish postfix from infix operators. Earlier, we could add a postfix bang operator only because the Perl 6 parser knows exactly where it is expecting a postfix, namely after a term with no intervening space. You couldn't write 42 ! there and still have it be interpreted as a postfix. Instead it would see the ! in infix position and treat it as a negating metaoperator for some subsequent boolean test, which might not even be a built-in operator, but one you defined yourself. There's never ambiguity in how it's parsed, though.

Another surprising regularization is that Perl 6 doesn't care whether your blocks are built-in or not. Any closing curly that ends a line is taken to be statement ending, so regardless of whether a construct is built-in or user-defined, you never have to worry about whether to put that pesky trailing semicolon afterwards, because it will always be assumed for you.

Well, that's just a start at answering your question. I hope this helps you understand some of the reasons for the syntactic refactor.

In what scenario is Perl 6 most ideal?
by orlanz

Use the best tool for the job they say. There are many areas that Perl excels at. But in your personal opinion, what kinds of scenarios, situations, tasks, and jobs are most ideal for Perl? What is it the best tool for?

LW: Perl 5 is really good at scanning and mangling text, and hooking up to external APIs via a trillion or so CPAN modules. It's a language that is good at getting out of your face when you just want to solve your problem. It's a good language for people who are learning to program, since it doesn't force you to learn everything up front. Historically, it's been a good workbench for experimenting with various OO and FP ideas (though sometimes at the expense of recommending one good idea).

Perl 6 expands on those strengths by upping its regex game to parsing with full grammars, and by making it almost trivially easy to interface to external libraries. It's still a language that rewards a learn-as-you-go style. It has even less boilerplate compared to Perl 5, and while you can still fiddle with your OO and FP metamodels if you try hard enough, the flexibility is now hidden under some very solid default implementations that will help cultural interchange between different shops. Yet the flexibility is there underneath so you can mold Perl 6 into whatever language you need next, so we think and hope that it will eventually be close to ideal for almost any situation, task, or job. (At least, once we get it running fast enough for whatever you need it for. We're still working on that...)

Double Question
by shaitand

According to most metrics Perl 5 usage hasn't decreased but there is a perception problem indicating it has. Perl usage outstrips python by a lot but many think the opposite is true. Why do you think this perception exists? Is it related to calling the new language Perl 6 giving people the false impression that Perl 5 hasn't progressed as dramatically as it has in the past few years?

LW: Not really. To my mind, Perl 5 is not much in competition with Perl 6 (except inside certain echo chambers). Perl 5's real competition for the last 16 years has been Python, Ruby, Lua, PHP, Javascript, Java, C#, Go, Racket, and Swift, to name a few. And it still stands up pretty well to all those competitors, for a very large problem space. Perl 5 is still way ahead of most other languages when it comes to Unicode support, and is still quite performant for the problems it's best at.

But arguably, each of those languages also offers at least one thing that Perl 5 doesn't do quite so well, or everyone would be using Perl 5.

So finally, we have an actual Perl 6 that can compete with all those languages too, at least in terms of features. One of the ways it does not yet compete with Perl 5 is in the area of performance, but the first half of this year we've already got it running nearly twice as fast as it was at Christmas. We've still got a lot of headroom for optimization. But Perl 6 has its eye on surpassing all those other languages eventually. Perl has always been about raising the bar, then raising it again, and again.

If you got a 'Do Over' for Perl 6..
by jjn1056

Hi Larry,

I'm a profession Perl 5 programmer who is very worried about the future of my language. I remember when you kicked off Perl 6 in the very late 1990s the talk was that it would replace Perl 5. Clearly that never happened. If you could redo the project what might you do differently?


LW: Well, the "talk" you mention was not particularly my talk. At the time, I mostly said that we were trying to do something impossible, and it would take a while, and the only reason we could aim so high is because Perl 5 was so stable and well-maintained, and would continue to be so for the foreseeable future. But people always get a bit more excited than strictly necessary, and when they do, they tend to fall into either/or thinking, when there's no reason not to have both/and. So it was natural that some people posed Perl 6's gain as Perl 5's loss.

Given that we were fighting this zero-sum thinking the whole time, I don't know what we could have done differently, in terms of culture, anyway.

But the fact is, the zero-sum fallacy aside, Perl 5's growth was already tapering off some (compared to other languages) even before we ever got started on Perl 6, because we were already running into some of the unfixable limits of the Perl 5 design. Fixing these structural issues by breaking backward compatibility was part of the motivation for Perl 6 in the first place. For instance, for historical reasons, the Perl 5 design relies too heavily on global state, both hidden and explicit, which in turn is the main reason it's so difficult to write multi-threaded code. Perl 6, in contrast, has no interpreter globals, and only a few natural process globals, such as your $*PID (which you can see is special because of the star, even if you don't know how it's special).

In reality, trying to figure out what we might've done differently is pretty meaningless. We did the best we could with what we knew at each moment. We made plenty of mistakes, but we tried to learn from them, and then make different mistakes.

So I don't wring my hands over the past much. Sure, we can study the past and learn from it. But I'm not really a historian at heart, because I care a lot more about the future, especially the bits I still have some influence over. As my father used to say to me all the time: "It's not what you do, it's what you do next."

And the next thing I see is both Perl 5 and Perl 6 doing their respective jobs pretty well for the foreseeable future, if we make sure the Perl community as a whole stays healthy.

Question
by mlwmohawk

Why is the syntax of Perl so bad? It lends itself to scripts that even the authors can't understand after a week or two.

LW: Obviously because I'm a bad person, and I hate you.:-)

Seriously, the most unreadable thing about Perl 5 is the regexes, and that's mostly not our fault. (Even if everyone else did steal (resteal?) Perl 5 regexes for their own language.) In any case, we fixed all that in Perl 6, unless you're one of the unfortunate few who breaks out in hives when they see sigils. Your grandma could read your Perl 6 code.

what do you think about the Perl guy?
by alloB

Perl is proven to be fundamentally broken. Here are two very entertaining videos about how to exploit weird array casting, hashes and so on. I really think every Perl programmer should have seen it.

What do you say about this criticism and the exploited flaws?


LW: "Doctor, it hurts when I do this!"

"Well then, don't do that."

Who's using Perl?
by quentindemetz

Which large companies are still using Perl in production? I can name Booking.com, but do you know any others?

LW: I daresay the majority of large companies are still using Perl, even if their managers don't know they're using it. ;-)

These days, as it was in the beginning, most of this usage is infrastructural, but certainly there are still some largely-Perl shops out there, such as CPanel, craigslist, and ZipRecruiter. Last I knew, Ticketmaster and Amazon were still heavy users of Perl, and many large financial institutions have made use of Perl as one of their "secret weapons" that helps them be agile in their financial analysis. But they tend not to advertise their trade secrets.

But in any case, I would like to believe that, even if we're at a local minimum for new project starts in Perl, in the future we'll see not only more projects in Perl 6, but maybe also more new projects in Perl 5, since some folks will be glad to start with something familiar if they know there's an upgrade path later if they want it. I could be wrong. I've been wrong before, but I've also been right before.;-)

Oops, I ran out of questions, and didn't finish with a bang. So...

BANG!

167 comments

  1. Comctl by Anonymous Coward · · Score: 3, Interesting

    When are we going to see a common controls library for perl that lets applications run natively on iOS, Android, Web, Windows, Mac OS X, and Linux so that we can have the same type of portability as Java without the suck and can write Perl apps in something like Visual Studio.

    1. Re:Comctl by Anonymous Coward · · Score: 0

      At least for some platforms, you could use Perl/Tk.

  2. Thanks for the great answers by hcs_$reboot · · Score: 5, Insightful

    Most of them deserve a 5 Insightful + 5 Funny :-)
    Was reluctant to do so, but now it seems I'll have to give Perl 6 a try!

    --
    Slashdot, fix the reply notifications... You won't get away with it...
    1. Re:Thanks for the great answers by Anonymous Coward · · Score: 0

      me too!

      I'm a big Perl5 fan, and thought Perl6 was a big mess... will have to give it a try :-)

    2. Re:Thanks for the great answers by bluefoxlucid · · Score: 2

      Eh it's a LW interview, of course he's going to talk up Perl 6 and should get props based on that assumption; no use bashing--wait, what?

      Somehow PHP has managed to convince a horde of programmers that if their programs are flakey or hard to maintain, it must somehow be the programmer's fault.

      Followed by "Perl is objectively a broken language"...

      "Doctor, it hurts when I do this!"

      "Well then, don't do that."

      PHP sucks because PHP is broken, and PHP has conned programmers into thinking it's their fault and not the fault of their shitty language. If you found certain language features lead to really shitty perl, it must be your fault and not the language's fault.

      ... -5 John Kerry.

    3. Re:Thanks for the great answers by phantomfive · · Score: 1

      I don't think many people would put Perl and PHP in the same category.

      --
      "First they came for the slanderers and i said nothing."
    4. Re:Thanks for the great answers by Pseudonym · · Score: 1

      Followed by "Perl is objectively a broken language"...

      There is a saying in the C++ community, that many language features are intended to protect against Murphy, not Machiavelli.

      Unlike Java, Perl does not even try to protect you from malicious programmers. Being a scripting language, Perl also doesn't try hard to protect you from careless programmers. Nonetheless, these particular examples of brokenness would be hard to encounter by accident. You can't say that of PHP.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    5. Re:Thanks for the great answers by ShakaUVM · · Score: 1

      >There is a saying in the C++ community, that many language features are intended to protect against Murphy, not Machiavelli.

      And yet as C++ progresses, it becomes easier and easier to write simple and performant code that can't be exploited. We're a long way from the strcpy() days. I can, for example, uppercaseify strings without ever using a pointer, iterator, square bracket, or at(). And the strict typing of C++ stops every one of the exploits detailed in those Perl Jam videos, with -Wall being there to watch for anything you can do that is technically legal, but a bad idea.

      >Unlike Java, Perl does not even try to protect you from malicious programmers. Being a scripting language, Perl also doesn't try hard to protect you from careless programmers. Nonetheless, these particular examples of brokenness would be hard to encounter by accident. You can't say that of PHP.

      Very true. You will definitely encounter more accidental weirdness in PHP. But long past are the days where it was common practice in PHP to pollute your variable namespace with parameters passed in by the user. But the point of those videos is that even if you are a security conscious programmer, following established language patterns, the weirdness of Perl - the language itself - works against you in your goal of trying to write secure code.

    6. Re:Thanks for the great answers by Pseudonym · · Score: 1

      And yet as C++ progresses, it becomes easier and easier to write simple and performant code that can't be exploited.

      True, but that's not what is meant by the phrase. "Machiavelli", in this case, refers to the programmer.

      In Java, "private" means "private". It is an abstraction which cannot be broken by the programmer. In C++, you can get at a private member of a class if you are sufficiently determined thanks to pointer shenanigans. But you can't do it by accident.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    7. Re:Thanks for the great answers by bluefoxlucid · · Score: 1

      So hard to encounter by accident that a five-line perl script allowed remote execution because someone used while(<file>) on a variable that they checked was a file, which turned out to also be a string, which turned out to contain the value "ARGV".

      That perl script was directly sourced from the perl documentation.

    8. Re:Thanks for the great answers by Pseudonym · · Score: 1

      Programs which accidentally allow remote execution in any non-managed language are easy to find. It's much harder to encounter a Perl script which breaks the security of the Perl language/VM itself.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    9. Re:Thanks for the great answers by bluefoxlucid · · Score: 1

      You mean like Bugzilla? Or did you mean DBI?

      Something tells me you have no idea what kinds of things perl is vulnerable to. Things like the user feeding a list as input, which causes all variables in a function call to shift down, thus giving the user control over variables which aren't user-input variables. The remote execution bug from CGI was from Perl::CGI validating an HTTP post with a foo=ARGV and a file upload named foo as foo being a file (because foo is ALSO a file), then passing foo (which should be an open file stream) to a while() loop, which caused perl to open the value of the first query parameter (which was "bar=|/bin/ifconfig"). Fortunately. Perl::CGI has been replaced by more-advanced systems which let the client pass a query parameter as a hash or an array of hashes or a hash of files or a hash of lists or a list of hashes, so even Perl's strict, secure mode, which knows not to trust that kind of user input in certain function calls, can be bypassed, because Perl considers hashes secure, since user input can't be passed into hashes.

      Network-exposed perl code is just waiting for anal rape, because the security model of the language is non-existent and the things that break the language are *extremely* hard to identify. It's ripe for dancing around user input validation, which is exactly what most security vulnerabilities in Perl applications have been: the programmer wrote code specifically to protect against bad user input, and someone passed user input that causes Perl to successfully validate bad input by somehow coupling it to good input. This is how people figured out how to turn off all that SQL magic quoting in Perl::DBI and carry out SQL injections on applications which properly protected against SQL injections. It's why finding half a dozen ways to get admin access to anyone's Bugzilla is a weekend project for a bored teenager.

    10. Re:Thanks for the great answers by Pseudonym · · Score: 1

      Something tells me you have no idea what kinds of things perl is vulnerable to.

      I think you might be missing the context of Larry Wall's remarks, and the attack vector that is being described. We are not talking about ways that a programming language can help protect the system that the program is running on from a malicious program, or from a carelessly written program. We are talking about ways that a programming language can protect its own virtual machine from having its own invariants broken.

      Java bytecode cannot crash a Java virtual machine no matter how hard the programmer tries. In all of the years of security holes in Java, not one of those holes was in the VM or classloader itself; they were all bugs in the standard library, and the security manager was one particular weak point. These bugs allowed remote attackers to get whatever privileges the VM has, but they still couldn't crash the VM using only Java code.

      By contrast, Perl code can crash a Perl virtual machine, however, it is so hard to do on purpose that Larry Wall's advice to "don't do that" really is a good way to guard against it. The Perl virtual machine protects itself from badly-written code, but not maliciously-written code because if (as Raymond Chen would put it) you're already on the other side of the airtight hatchway, there are easier ways to do it.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    11. Re:Thanks for the great answers by bluefoxlucid · · Score: 1

      No, I'm not talking about the VM crashing because of badly-written code; I'm talking about the VM allowing you to make it do things.

      It's possible to write Perl code that opens a program and runs it, or opens a file and writes it. It's *also* possible to write a perl program which does nothing of the sort, except--oops--it does, because of the way perl's language features work, and all the unexpected shit that can happen when using perl. The VM doesn't crash; it operates *exactly* as designed, and that design is arcane, confusing, and ridiculous.

      Again: real-world examples include users getting lists into perl, purpose-written libraries (e.g. CGI, DBI) validating that user input as safe, and then that user input telling Perl to execute programs or to make function calls in which the user has supplied the value of parameters specifically *not* supplied by the user.

      So your "Maliciously-written code" includes Bugzilla, CGI, and DBI.

    12. Re:Thanks for the great answers by Pseudonym · · Score: 1

      No, I'm not talking about the VM crashing because of badly-written code; I'm talking about the VM allowing you to make it do things.

      And that's correct. However, you are not talking about what Larry Wall was talking about when he said "don't do that".

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    13. Re:Thanks for the great answers by bluefoxlucid · · Score: 1

      Then Larry Wall avoided the question by giving an answer to something else. The original poster was talking about EXACTLY WHAT I AM DESCRIBING. He linked to videos of presentations by Netanel Rubin, who demonstrated this code is vulnerable:

      use strict; use warnings; use CGI;

      my $cgi = CGI->new;

      if ( $cgi->upload( 'file' ) ) {

      my $file = cgi->param( 'file' );

      while ( <$file> ) { print $_; }

      }

      This allows remote code execution. He also showed how to break REST APIs that create hashes from user input, as well as the myriad of options opened up if the Perl script uses Catalyst or Mojolicious instead of CGI.PM, which allows you to fill variables with things like lists of hashes.

      To be clear about perl: when you evaluate a list as a variable, perl gives a result essentially idempotent with performing the operation on each element of the list and returning the final state--i.e. the immediate result is whatever the result would be if you passed the last element of the list. When you pass a variable containing a list to a function call, perl interprets this as passing the next several parameters, i.e. foo(a, b, c) if given (b) as a list will pass the first element of (b) as (b) and the SECOND element of (b) as (c). This means a lot of validation code breaks quickly when the user sneaks a list into Perl somewhere.

      Hashes do similar things: if you can manage to append a value to a hash, it will overwrite an earlier value. Again, perl processes in serial: {a=1, b=2, c=3, b=4} will do exactly what you'd imagine it doing if you iterated through that list as a step-by-step operation instead of an atomic operation, and you will get {a=1, b=4, c=3}. This effectively allowed people to create admin accounts on Bugzillas for a while by submitting their verification form with a list in the password field: Perl would expand the password {pw=$foo} to include all list elements {pw=(foo, bar, baz)} becoming {pw=foo, bar=baz}, and so, of course, you could stick a new entry for an e-mail address into their hash {email=foo@bar, pw=foo, email=admin@mozilla.org}. Congratulations: you are now a Bugzilla administrator.

      THAT is what the OP had asked Larry. Specifically. With examples.

    14. Re:Thanks for the great answers by Pseudonym · · Score: 1

      OK, we have been talking cross-purposes it appears. I went back to the question and I did indeed miss one crucial detail in it.

      My fault. Sorry about that.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
  3. Wow by twistedcubic · · Score: 4, Interesting

    This is the best interview I've ever seen on Slashdot. Thanks!

    1. Re:Wow by Anonymous Coward · · Score: 0

      Concurred, great interview. Thank you Larry Wall.

    2. Re:Wow by starless · · Score: 1

      Except it's annoying (to me anyway) that the "editors" didn't correct basic spelling and grammar mistakes in the questions before posting...

    3. Re:wow by Anonymous Coward · · Score: 0
      The "billions" he is referring to is the money he didn't make from rn patch and Perl.

      Of course he doesn't actually think that he would have made that much money, he is just making a clever turn of phrase

      Also most of the things he wrote about Python are very similar to things I've seen stated by Python programmers.

    4. Re:wow by superwiz · · Score: 1

      I know what he is referring to. Most of the money from Perl was made by O'Reilly Press. They published documentation dumps on Perl, Perl modules and everything and anything Perl and people bought those when Perl was in vogue (even if they never read them). The collective cost was probably comparable to what he would have gotten if he released Perl commercially and charged per-copy license fee (and got paid for about 1/3 of all copies which were in use).

      --
      Any guest worker system is indistinguishable from indentured servitude.
    5. Re:wow by superwiz · · Score: 1

      Also most of the things he wrote about Python are very similar to things I've seen stated by Python programmers.

      That doesn't make them true. I started using Python around version 1.2 (ONE point 2). So I am going to claim that I am fairly familiar with the language. Despite the fact that Python 3 broke some C code which uses Python and despite the fact that Python 3 features are still backported to Python 2.7 branch, the push to Python 3 to replace Python 2 is there. It just happens to be more of a gentle nudge than a push. But this fact, in itself, signifies that Python 3 is meant to replace Python 2 and that's the opposite of what he said.

      --
      Any guest worker system is indistinguishable from indentured servitude.
    6. Re:wow by Anonymous Coward · · Score: 0

      You mean the one where you have to append a comma to suppress the automatic newline? Most intuitive feature ever!

  4. Re: #!/bin/perl by Anonymous Coward · · Score: 0

    Yeah, all of Europe is on the same timezone.

  5. Re:#!/bin/gaysex by Anonymous Coward · · Score: 0, Offtopic

    Get a grep of yourself!

  6. Perl is awesome! by Anonymous Coward · · Score: 0

    Great interview. I first learned perl back when I was in high school, learning how to create web sites with interactive components. My first impression was that perl was specifically for web sites. Only later did I learn that perl is a "swiss-army knife" that can be found on just about all UNIX systems.

  7. Larry on PHP by Anonymous Coward · · Score: 2, Insightful

    Larry doesn't say much about PHP other than a veiled insult.

    What Perl could have learned from PHP is the value of providing an easy learning curve. PHP creator Rasmus Lerdorf is, lets face it, a much worse designer and coder than Larry. Interviews with him are scary because of that. He is the kid whole was at the bottom of your coding class, yet churned out a product adored by hundreds of thousands people.

    PHP didn't achieve that sort of success because of Lerdorf's flaws. It succeeded despite them. Because of that easy learning curve. Perl's failure to fix its steep learning curve problem is why PHP has survived while Perl has struggled. http://www.fastcompany.com/302... It's also why newer languages like Python and Ruby which fixed PHP's flaws *and* have an easy learning curve did so well.

    Perl will always be around, but if it doesn't make a serious attempt to fix the learning curve problem, it'll end up the wrong kind of 1%er.

    1. Re:Larry on PHP by Anonymous Coward · · Score: 2, Insightful

      We all have different values. I see no value in striving to be the king of idiots. PHP continues to suck and it continues to be used for stuff that sucks, no matter how popular. Donald fucking Trump, a laughable embarrassment to most of the rest of the world, is more than a fringe outsider in US politics. That doesn't mean more people should aspire to behave like Trump.

    2. Re:Larry on PHP by Anonymous Coward · · Score: 1

      > Perl will always be around, but if it doesn't make a serious attempt to fix the learning curve problem, it'll end up the wrong kind of 1%er.

      You're not the first to say such a thing. A while back many Perl folk decided to try improve Perl in various ways and addressing the learning curve was very much a part of what they wanted to do. They shipped the first official fruit of that effort a few months back. It looks like it'll be another year or three before 7 year olds start having fun with the new Perl (there's "easy" and there's "ELI7 easy") but please rest assured the Perl community is on the case and many outsiders who actually try the new Perl say it's a great improvement in many ways including the learning curve.

  8. Stupid python comment by Viol8 · · Score: 1, Troll

    " Perl has always considered itself primarily a programmer-centric language, while Python has always considered itself to be more institution-centric. So in a sense it's a bit dumbed down, much like Java. You'll note both of those languages make their greatest appeal to managers. :-) "

    What a pile of steaming ****. I'm a C++ programmer (so I'm used to obtuse syntax), not a manager but I'd always choose Python over Perl since I want a scripting language to have a lot of useful libraries (yes, perl has those too) but crucially I want any code I write in it to be obvious what its doing not only to other coders in the future but to me too! Now I don't much care for the whitespace-is-indentation aspect of Python, but aside from that its syntax kicks Perls backside I'm afraid. It someone might think its clever to write a 10 line script in perl that can process an entire DB and make the coffee at the same time, but I'd sooner have to work on the 50 line python script that I can actually understand in 10 mins, not 3 hours. Too many sigils in a language does NOT aid clarity - it has exactly the opposite effect. Line noise is not a good look for code.

    1. Re: Stupid python comment by Anonymous Coward · · Score: 0

      So... how exactly do sigils compel (or even allow) you to squeeze what would otherwise be five lines of code into one?

    2. Re: Stupid python comment by Viol8 · · Score: 1

      They don't, they simply add to the already unreadable brevity due to a lot of implicit functionality.

    3. Re:Stupid python comment by dmbasso · · Score: 1

      Thanks for your comment, it expresses my view pretty well. I want to add a note about this:

      Also, Python has done pretty well as a first programming language, even if the design runs out of steam at certain points. In contrast, we tend to think of Perl (especially Perl 6) more as a last programming language, the language of choice for people who need a language that won't give up when the going gets tough.

      I started coding with BASIC and Z80 Assembly in the late 80's, then coded mostly C until 97 when I switched to C++, then finally in 2006 I switched to Python as main programming language. In these ~30 years I obviously had to program in several other languages, and Perl is by far the one I most hated. After my bad experience with Perl I even translated some Perl scripts coded by a biologist friend (Perl seems to be strong in the field) to show her how much more clear and concise they can be made in Python, and the difference is undeniable.

      So it seems to me that Python (with occasional C extensions for speed) is a suitable "last language", though what the future holds no one knows. Except that it will be neither Perl 5 nor 6.

      P.S.: JavaScript as it was in the beginning was pretty terrible too, even if it had a saner syntax. But it redeemed itself in the latest ES standards, and with the recent frameworks it is actually quite enjoyable.

      --
      `echo $[0x853204FA81]|tr 0-9 ionbsdeaml`@gmail.com
    4. Re:Stupid python comment by Anonymous Coward · · Score: 3, Insightful

      It someone might think its clever to write a 10 line script in perl that can process an entire DB and make the coffee at the same time, but I'd sooner have to work on the 50 line python script that I can actually understand in 10 mins, not 3 hours.

      I don't see why the Perl script must be written in ten lines. Surely it can take 40-50 lines and be understandable in ten minutes?

    5. Re:Stupid python comment by Anonymous Coward · · Score: 4, Insightful

      After my bad experience with Perl I even translated some Perl scripts coded by a biologist friend (Perl seems to be strong in the field) to show her how much more clear and concise they can be made in Python, and the difference is undeniable.

      a) Scientists are terrible at Perl. "You can write FORTRAN in any language" applies to them; they often write Perl as if it were C. Or that's my experience based on Stack Overflow and Perlmonks questions. They aren't programmers, they're scientists, and it shows.

      b) A rewrite is always clearer, no matter the language.

    6. Re:Stupid python comment by Anonymous Coward · · Score: 0

      Too many sigils in a language does NOT aid clarity - it has exactly the opposite effect. Line noise is not a good look for code.

      Yup, and now people can get even more "clever" by using unicode chars and custom operators. Oh look, it's the poo-emoji function, wonder what it does...
      I guess one way to reduce line noise is by hiding it because your local font doesn't contain all UTF codepoints...
      It seems Perl 6 is a great language to write your own code in, but other people's code will be even more cryptic than Perl 5.

    7. Re: Stupid python comment by Anonymous Coward · · Score: 1

      Whereas a function called "poo()" would be perfectly clear? It's the programmer's job to use sensible names, in any language, no matter what set of characters is available to choose from.

    8. Re:Stupid python comment by dmbasso · · Score: 1

      a) Scientists are terrible at Perl. "You can write FORTRAN in any language" applies to them; they often write Perl as if it were C. Or that's my experience based on Stack Overflow and Perlmonks questions. They aren't programmers, they're scientists, and it shows.

      Yep, that's usually the case.

      b) A rewrite is always clearer, no matter the language.

      You are right, of course, and as I used the word "translated", that could imply a rewrite. I should have used "transliterated", as I kept the original structure.
      I tried to find these scripts so I could give a concrete example, but I could only find my Python versions. But it was stuff in Perl like

      open($file, "file.txt");
      my $data = do { local $/; <$file> };

      that in Python becomes

      data = open("file.txt").read()

      that makes you think, wtf Perl??? Really, why do you need all that crap just to read the whole file?

      --
      `echo $[0x853204FA81]|tr 0-9 ionbsdeaml`@gmail.com
    9. Re:Stupid python comment by Anonymous Coward · · Score: 3, Informative

      that makes you think, wtf Perl??? Really, why do you need all that crap just to read the whole file?

      It's mostly because Perl is line-by-line by default. Most of the time you don't want to read a whole file into memory, do you?

      local $/; switches to slurp mode (temporarily).

      You could also do my @data = <$file>; which slurps the whole file, line-by-line, into an array, if that's what you need.

    10. Re:Stupid python comment by Anonymous Coward · · Score: 2, Informative

      ... I'd always choose Python over Perl since I want a scripting language to have a lot of useful libraries (yes, perl has those too) but crucially I want any code I write in it to be obvious what its doing not only to other coders in the future but to me too!

      I get what you're saying (and agree with the general thought process), but I cease to see how this makes Python a "better" choice over Perl (or more importantly, any other language). I'll share my view, and I apologise in advance for my lack of brevity.

      There is a common misconception that any Perl written is obfuscated or difficult to read. I've been doing Perl since the mid-90s. I'm 39. I'm a UNIX systems administrator by profession. Every piece of Perl code I've written has been intentionally readable, for two audiences: 1) people in the company or organisation who will be looking at it (and I have no idea what their Perl experience level will be, so I assume little-to-none), and 2) myself (why would I think 6 months from now I'll remember all the details of said code?).

      I have never taken the time to write "tips" on how to write clear Perl code, but ones that come to mind: I avoid use of functions that can result in "easy one-liners" which aren't immediately obvious (example: I avoid map and grep if I can, instead doing things the long way (manual loops and other approaches)). I avoid multi-line regexes. I keep consistent spacing/indentation. I avoid excessive reliance on modules or external dependencies (esp. those from CPAN; I spend a lot of time reviewing CPAN modules before picking one (in one personal project, I even wrote a file called horrible_perl_modules.txt that outlines why I chose Config::Record over several other configuration file parsers; many on CPAN are a travesty)). I avoid lists when possible. I use warnings and strict exclusively. I choose procedural over OO, unless turning something into a module provides some kind of massive benefit (e.g. needing several independent copies of several functions/data that all have to be independent in one running process where using an array of references would be more painful). I use "inverted syntax" (ex. print "hello\n" if ($something);) only if it truly provides great savings or has a better visual flow.

      For code that's not immediately obvious, or complex: that's what comments are for. I cannot stress this enough. I tend to comment heavily, especially in scenarios where I'm doing something for a damn good reason. Examples: use of "uncommon" regex things (e.g. the s///e flag, look-ahead matches), loops that seem a little non-intuitive, a function that I wouldn't normally use but found it to be beneficial for some reason, and sometimes when I'm using split (because the pattern match in split often does not behave how one might assume it does). I'll write a 5-6 line comment justifying the "why", and sometimes even reference URLs. If I'm parsing text (very common!), I might include some sample input so the reader doesn't have to switch windows or take their eyes off the general area they're looking.

      That said: I find programmers jerking off over how much they can fit into a single line, or how "awesome" some thing is even though it's completely illegible, infuriating. But these people exist regardless of what PL is used. And while I have an assembly background (65xx and x86), do C regularly, and work on embedded architectures, meaning I can appreciate someone saving CPU cycles and/or saving bytes, that isn't the driving force in these cases.

      My point here is this: the top thing I come across people complaining about when it comes to Perl is it's illegibility due to syntax. But I've encountered equally offensive code -- either due to syntax, or (more commonly) excessive complication/obfuscation due to abstraction (i.e. OO) -- in Python, Ruby, JavaScript, C, C++ (don't get me started on templates), assembly, and several other PLs. I grow tired of hear

    11. Re:Stupid python comment by Anonymous Coward · · Score: 0

      I want any code I write in it to be obvious what its doing not only to other coders in the future but to me too!

      You can try adding comments and/or write more perl code, which will enable you to read perl in the future.

    12. Re:Stupid python comment by Anonymous Coward · · Score: 0

      in perl6, you can write:

      my $string = slurp 'file.txt';

    13. Re: Stupid python comment by Anonymous Coward · · Score: 0

      Even better, you can write that in Perl 5 too, if you spend 30 seconds defining a "slurp()" function (and no doubt there's a module somewhere that already has it).

    14. Re: Stupid python comment by Anonymous Coward · · Score: 0

      Yes, of course:

      use Perl6::Slurp qw(slurp);

    15. Re:Stupid python comment by dmbasso · · Score: 1

      It's mostly because Perl is line-by-line by default. Most of the time you don't want to read a whole file into memory, do you?

      [...]

      You could also do my @data = <$file>; which slurps the whole file, line-by-line, into an array, if that's what you need.

      I can't say "most of the time", my guess is I use equally reading the whole file, reading chunks of binary files, and reading lines.

      local $/; switches to slurp mode (temporarily).

      Ahhh, of course!!! That's obvious! </sarcasm>

      Not only the syntax is cryptic, the terminology is terrible! "Slurp" is a funny way to describe the process, but introduces one more step (two more for non-native speakers) to understanding it. Compare that to Python's `file.read()` and `file.readlines()` and you'll understand why Python is better for beginners and for people that want maintainable code.

      Shakespeare's style might be great for poetry, but if you use it to write guides, don't be surprised if people get lost.

      --
      `echo $[0x853204FA81]|tr 0-9 ionbsdeaml`@gmail.com
    16. Re:Stupid python comment by Viol8 · · Score: 1

      "For code that's not immediately obvious, or complex: that's what comments are for."

      Agreed. But sadly a lot of coders think comments are for sissies, so given that I'd sooner have to read their uncomment mess in python than perl.

      "Have you ever used the MySQL-python extension (a.k.a. MySQLdb)"

      No, but I've used Cx_Oracle and that seemed fine to me. Anyway, you can't blame the language for someones bad library design. That happens in every language.

    17. Re:Stupid python comment by Anonymous Coward · · Score: 0

      I want any code I write in it to be obvious what its doing not only to other coders in the future but to me too!

      I think Larry makes a good point. This whole cliche about Perl's readability is pretty much entirely about regular expressions. And those are always going to be hard to read -- by definition, because you're chopping meaningful units into their smaller components. (Which every other language eventually tries to copy...) And then we blow these things up into massive holy wars about which language is unacceptable. (I mean, there could just as easily be a meme about how Python is horrible because of its onerous "whitespace-is-indentation" requirement...)

    18. Re:Stupid python comment by Anonymous Coward · · Score: 0

      Reminds me of an ad I saw the other day for an authorization library or some such, and one of the guys in the commercial said "implementing secure authorization systems is hard. Doing it right is even more difficult"

      The programmer mentality that there are different levels of programming something correctly is a testament to how bloody ignorant we all are in general.

    19. Re:Stupid python comment by CaptSlaq · · Score: 2

      " Perl has always considered itself primarily a programmer-centric language, while Python has always considered itself to be more institution-centric. So in a sense it's a bit dumbed down, much like Java. You'll note both of those languages make their greatest appeal to managers. :-) "

      What a pile of steaming ****. I'm a C++ programmer (so I'm used to obtuse syntax), not a manager but I'd always choose Python over Perl since I want a scripting language to have a lot of useful libraries (yes, perl has those too) but crucially I want any code I write in it to be obvious what its doing not only to other coders in the future but to me too! Now I don't much care for the whitespace-is-indentation aspect of Python, but aside from that its syntax kicks Perls backside I'm afraid. It someone might think its clever to write a 10 line script in perl that can process an entire DB and make the coffee at the same time, but I'd sooner have to work on the 50 line python script that I can actually understand in 10 mins, not 3 hours. Too many sigils in a language does NOT aid clarity - it has exactly the opposite effect. Line noise is not a good look for code.

      Just because your programmers golf stuff because they can doesn't mean that ALL programmers golf stuff. Bad code exists in EVERY language, because there's no limit to bad programmers, speaking as one who considers themselves mediocre at best.

      Saying that "perl sucks because clever programmers try super hard to be clever because they can" isn't a verdict against perl. I would say that any language that's flexible enough to allow for such things will allow clever programmers to pull stunts like that.

    20. Re:Stupid python comment by Anonymous Coward · · Score: 1

      I can't say "most of the time", my guess is I use equally reading the whole file, reading chunks of binary files, and reading lines.

      Well, binary files aren't read with the line-by-line <> operator but with the read() function. So it fails in only 1/3 of your use cases.

      local $/; switches to slurp mode (temporarily).

      Ahhh, of course!!! That's obvious! </sarcasm>

      Not only the syntax is cryptic, the terminology is terrible! "Slurp" is a funny way to describe the process, but introduces one more step (two more for non-native speakers) to understanding it.

      Frankly, there are other ways that make sense for beginners. A while loop that appends to a string is common, for example.

      $data .= $_ while <$file>;

      Compare that to Python's `file.read()` and `file.readlines()` and you'll understand why Python is better for beginners and for people that want maintainable code.

      Yes, I know, you can have easy-to-read functions like that with an OO design. Use the module IO::File if that's what you want. It's included in the base Perl distribution. It provides the methods getline, getlines ... hm, it doesn't seem to provide a binary read method for some reason. Odd.

    21. Re:Stupid python comment by Anonymous Coward · · Score: 0

      hm, it doesn't seem to provide a binary read method for some reason. Odd.

      Sorry, the binary read was read, of course. It was typeset differently in the perldoc which is why I didn't see it.

    22. Re:Stupid python comment by epine · · Score: 4, Insightful

      Agreed. But sadly a lot of coders think comments are for sissies, so given that I'd sooner have to read their uncomment mess in python than perl.

      Every language debate on Slashdot eventually winds up here.

      Some programmers hate their peers. These programmers choose languages that are good for hating your peers (Java, Python).

      Some programmers admire their peers. These people write "in my shop we've been using C++ for a decade now, and while it's far from a perfect language, we've never really had a problem with it".

      Thesis: Many of the people who hate their peers suck as teachers.

      True? False? Hard to say.

      Personally, I know that I like my peers a lot more when I unselfishly contribute to their growth as programmers. But, hey, suit yourself. Sit in the corner all alone reading 50 lines of pablum, where 10 lines of well judged code would have done the job instead, without even lapsing into arcane idiom.

      My personal hell is paved with pablum.

    23. Re:Stupid python comment by Zero__Kelvin · · Score: 1, Flamebait

      "a) Scientists are terrible at Perl. "

      You have that backwards. Perl is terrible at scientists. Perl is terrible at everyone except Larry Wall and a handful of other hacks that can't see why it is a truly abhorrent language.

      "b) A rewrite is always clearer, no matter the language."

      Ah. Now I see the problem. You have never actually written anything in Perl! ;-)

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    24. Re:Stupid python comment by Viol8 · · Score: 0

      Whatever it is you're smoking I suggest you refrain. Once your brain fog has cleared you might be able to write a coherent post.

    25. Re:Stupid python comment by Anonymous Coward · · Score: 0

      > Python ... syntax kicks Perls backside

      Python and Perl are decades old languages that have gone through multiple major versions, some of which are huge leaps. Would you agree that:

      * Perl 4's syntax kicks Python 1's backside.

      * Python 2's syntax kicks Perl 5's backside.

      * Perl 6's syntax kicks Python 3's backside.

      If not, please be specific about the major versions you're comparing and your experience with those versions. TIA.

    26. Re: Stupid python comment by dolmen.fr · · Score: 1

      I notice you used a comma in your sentence because it has a meaning and add information to the sentence in addition to just letters. You could have used bold and italics. Sigils in Perl have the same purpose.

    27. Re:Stupid python comment by dolmen.fr · · Score: 1

      You can always cleanup that Perl 5 code using a module such as Path::Tiny:

      use Path::Tiny;

      my $data = path('file.txt')->slurp;

    28. Re: Stupid python comment by Anonymous Coward · · Score: 0

      Don't you have that the wrong way around? Wouldn't a complaint about implicit functionality need to be leveled at the sigil-free version?

              foo[28] = "quux"; # assign string "quux" to the 29th element of the foo array
              @bar[42] = "waldo"; # assign string "waldo" to the 43rd element of the @bar array

    29. Re:Stupid python comment by Anonymous Coward · · Score: 0

      No, but I've used Cx_Oracle and that seemed fine to me.

      Maybe that one is "fine", if that's all you do. I work with (or have worked with) Sybase, Oracle, Informix, PostgreSQL, and MySQL...and let me tell you how nice it is to have ONE database library that works the same for all of your database needs.

    30. Re:Stupid python comment by Anonymous Coward · · Score: 0

      I don't know, when they can't even get something as simple as netrc right, I get wary about everything else:

      http://stackoverflow.com/questions/12674888/can-netrc-handle-passphrases-with-spaces

    31. Re:Stupid python comment by Qzukk · · Score: 1

      using % or , (comma), but for some reason "comma is safe" (I do not understand this syntactical inconsistency)

      In python, % is an operator, taking the items on the right-hand side and inserting them into the string on the left-hand side. This operator is not SQL aware, so the items are simply inserted into the string without even trivial escaping.

      The comma separates arguments, making the list of items a second argument for execute() to properly handle, hopefully using the database's prepared statement execution method.

      --
      If I have been able to see further than others, it is because I bought a pair of binoculars.
    32. Re: Stupid python comment by Anonymous Coward · · Score: 0

      Yes, but, again, folk, sometimes, take, things, too, far.

      Seriously, a lot of perl code I see has too many sigils for my taste.

      I like that Perl 6 lets me put a slash where the sigil usually goes to declare a sigil-free variable (which then has nice SSA properties https://en.wikipedia.org/wiki/Static_single_assignment_form):

              my \dict = { keya => 'avalue', keyb => 'bvalue' }
              dict = 'cvalue';
              say dict # displays bvalue

    33. Re:Stupid python comment by Camel+Pilot · · Score: 1

      I dunno but I do

      open($file, "file.txt");
      my @data = <$file>;

      To slurp in a whole file

    34. Re:Stupid python comment by Anonymous Coward · · Score: 0

      You can always clean up that Perl 5 code using a module such as Path::Tiny:

      use Path::Tiny;

      my $data = path('file.txt')->slurp;

      FTFY.

      Cleanup is a noun. Clean up is a verb.

    35. Re:Stupid python comment by Anonymous Coward · · Score: 0

      Why do you think they made perl 6?

      my $data = slurp $filename;

    36. Re:Stupid python comment by doom · · Score: 1

      Well, in some ways this isn't a bad thing to bust perl on, because most of us would agree that doing something like a "local $/;" is a bit of cruft we're stuck with for legacy reasons. But on the other hand, neither form is something that a beginner would know without being told, really you're going to need to be handed an example to learn it, so the actual practical difference between the two isn't that huge.

      Interestingly, there have been multiple attempts at cleaning up this particular cruft but none have really caught on: the trouble is all perl programmer's understand it already, so if you do something even slightly different, like: use English; local $INPUT_RECORD_SEPARATOR = undef; You can end up damaging readability in an attempt at improving it.

    37. Re:Stupid python comment by doom · · Score: 1

      By the way, the Perl 6 way of doing this is:

      # read entire file as (Unicode) Str
      my $text_contents = slurp "path/to/file";

      See: https://docs.perl6.org/routine/slurp.html:

      And the same thing can be done in perl 5 with the CPAN module Perl6::Slurp: https://metacpan.org/pod/Perl6::Slurp

      I look forward to hearing why Python's chained method call syntax is so much more newbie-friendly than a single, colorfully-named built-in command.

    38. Re:Stupid python comment by dmbasso · · Score: 1

      But on the other hand, neither form is something that a beginner would know without being told, really you're going to need to be handed an example to learn it, so the actual practical difference between the two isn't that huge.

      A beginner wouldn't know that a "read" method exists in a "file" object. But when confronted with a "file.read()" invocation, the meaning seems pretty straightforward to intuit.

      Now, "local $/;" gives you absolutely nothing to reason over it. Only after your explanation I have a grasp on what's happening (which in Python could be represented with "".join(file)) , though I still don't understand how the $/ syntax means $INPUT_RECORD_SEPARATOR = undef.

      --
      `echo $[0x853204FA81]|tr 0-9 ionbsdeaml`@gmail.com
    39. Re:Stupid python comment by doom · · Score: 1

      Ah, well, "local" assigns a temporary, dynamically scoped value to "$/", defaulting to an "undef", i.e. undefined.

      "English" is a module that provides alternate, more readable names for the old-style globals like "$/". It hasn't really caught on, so my point is that using it would be a source of confusion for different reasons.

      It is however, pretty funny that on a typical unix box a "man English" will take you to the docs for an odd perl module.

  9. If your employer is Craigslist by maroberts · · Score: 1

    Please start writing some 1337 scripts to sort the spam issue out. kthx

    --

    Donte Alistair Anderson Roberts - hi son!
    Karma: Chameleon

  10. This interview can't have been with Larry Wall by Anonymous Coward · · Score: 1

    it was readable

  11. something worth reading in full at /. for a change by sittingnut · · Score: 4, Informative

    read title.

  12. Um, wtf LW? by Anonymous Coward · · Score: 0

    "LW: Well, my spies inside Microsoft tell me that Perl is actually used quite heavily internally, so maybe I haven't been beating my wife quite so much as the question would indicate. :-) "

    Creepy smile there Larry...

    1. Re:Um, wtf LW? by kwoff · · Score: 2

      Maybe if you don't understand what he's saying. He's referring to the canonical Have you stopped beating your wife? example of a loaded question.

    2. Re:Um, wtf LW? by Anonymous Coward · · Score: 0

      Kind of a stretch, although I'm sure you're right. It makes his smile no less creepy. A programmer of all people should be aware of how associations work. Then again, Perl is a "special" kind of programming.

    3. Re: Um, wtf LW? by Anonymous Coward · · Score: 0

      For those that don't get the reference, he's saying that the question implies a false dichotomy, like the classic example he referenced: "Yes or no, have you stopped beating your wife?"

  13. Perl 6 is a thing? by anchovy_chekov · · Score: 1

    So.. Perl6 is actually finished? Or is that the wrong sort of question to ask?

    1. Re:Perl 6 is a thing? by invictusvoyd · · Score: 2

      Perl 6 on GNU HURD is going to be the year of the linux desktop

    2. Re:Perl 6 is a thing? by invictusvoyd · · Score: 1

      That's technically incorrect but humor acccepted

    3. Re:Perl 6 is a thing? by CaptSlaq · · Score: 1

      Christmas 2016 was the first official release. Damian Conway gave a great keynote at YAPCNA::2016^H^H^H^H^H^H^H^H^H^H^H^H^ TPC::2016 on the use of it.

    4. Re:Perl 6 is a thing? by skids · · Score: 2

      A "release" was made, by which it is meant that there is a contract between the
      developers and the users: the developers will not break things that are tested
      for and currently pass in the test suite until the next version, and for the most part
      any changes to the test suite (and thus, behavior) in that next version have to
      be well justified, documented in release notes, etc.

      Also, a lot of features work and as a whole the language is very usable.

      If you'd been playing with Perl 6 before this, there was a *lot* of very frequent
      and sometimes drastic churn which would require tweaks to scripts or modules
      you'd written. This required a lot of patience by those working in that environment,
      so it was not suitable to declare Perl 6 open for business at that time.

      Now, if you're really worried about not having to edit something after an
      upgrade, you can check to see if the behaviors used are bound by that
      contract by finding examples of their use in the test suite.

    5. Re: Perl 6 is a thing? by Anonymous Coward · · Score: 0

      Christmas already happened?? 2016 is wild.

    6. Re: Perl 6 is a thing? by CaptSlaq · · Score: 1

      Christmas already happened?? 2016 is wild.

      Derp. Even preview won't save me from myself.

  14. This is the best thing that's been on /. in years. by Anonymous Coward · · Score: 1

    Thanks Larry.

    whiplash et al: More of this!

  15. Thanks Larry by Anonymous Coward · · Score: 2, Insightful

    Thanks Larry for the answers!

    And thank the heavens that Slashdot actually managed to get somebody who answers the damn questions instead of giving tiny meaningless answers.

  16. Re: #!/bin/perl by Eunuchswear · · Score: 1

    He said "here" in Europe. Wherever "here" is it has only one timezone.

    --
    Watch this Heartland Institute video
  17. Odd Perl assignment operator by Anonymous Coward · · Score: 0

    Since Mr. Wall answered a question about language design, I wonder how he managed to invent an assignment operator that modifies the right hand side.

    1. Re:Odd Perl assignment operator by Anonymous Coward · · Score: 0

      Because he's OK with OO?

      Unless you're happy with spreading FUD you'll have to be a lot more specific.

  18. Vai tomar no cú Grupo Empreza by Anonymous Coward · · Score: 0

    Eu quero mais que essa merda da Helena se mate enfiando a Samanta no cú dela e que meu caralhou cresça.

  19. Re: #!/bin/perl by Anonymous Coward · · Score: 0

    Russia has eleven time zones. Russia begins in Europe.

  20. Re: #!/bin/perl by Anonymous Coward · · Score: 0

    Yes, and if he's in Russia, then "here" refers to whichever part of Russia he's in, not the entire country.

  21. Great answers Larry! by mykepredko · · Score: 3

    As always, we appreciate the time taken to respond to the questions and you're insight into the life, the universe and everything.

  22. Compiled languages by Anonymous Coward · · Score: 0

    First, great questions and answers, thanks! Really awakened my interest in Perl.

    How do you see Perl in relation to compiled languages (to give a spectrum: C, Java, Rust)? I know performance will be the first thing that many people will think about, but there are many other interesting issues: when optimisation happens, how concrete library APIs are, API documentation (including how unexpected input is handled), when bugs are detected in your code (compiler/validator or run-time), how many bugs can detected just by compiler/lint tools.

    1. Re:Compiled languages by skids · · Score: 2

      Perl 6 aims to be a compiled language and in large part already is -- just, the compiler needs a lot of work to catch up to more established languages. There is still the ability to compile Perl 6 code from a Perl 6 program which could be interpreted as interpretation, but most people won't be doing that.

      The compiler already does a fair amount of compile-time bug detection. Best way to know more is to play with it.

    2. Re:Compiled languages by Anonymous Coward · · Score: 1

      Perl 6 is (mostly) ideologically non-ideological.

      Thus, for example, to the degree compilation is clearly the sensible thing to do, a Perl 6 compiler is enabled and encouraged to compile things. Thus many typos, type errors, etc. are caught at compile-time. In contrast, by default, public method calls are late-bound. And so on.

  23. Re: #!/bin/perl by Anonymous Coward · · Score: 0

    Two, actually. Normal time and summer time.

    EET and EEST.

  24. I tried watching the videos mentioned by Anonymous Coward · · Score: 4, Interesting

    Perl is proven to be fundamentally broken. Here are two very entertaining videos about how to exploit weird array casting, hashes and so on. I really think every Perl programmer should have seen it.

    I didn't know about the videos and tried watching them, but I couldn't finish they since they seemed to me very idiotic. He seems to "misunderstand" a lot of very useful features of perl on purpose, and poses as a big WTF the fact that it doesn't die on every weird thing he tries. And people in the audience actually find it funny... Enabling warnings (as you always should) would generate a helpful and explanatory warning on each of these occasions. Also, Perl has references for many things that don't work as he "expects". The only truth is that there are some sloppy programmers that leave vulnerabilities, but that happens regardless of the language. The guy should also work a bit of his articulation if he wants to be a public speaker, sure I am ESL too, but that doesn't mean I don't try to sound clear...

    As for the coding style, apart from regexes which are hard to read for almost everyone (and not just in Perl), I have found that if you don't try to be a smartass (e.g. super-concise or obfuscate on purpose) when writing Perl code, it can be quite readable. For example, when I finished my Master's project which involved a lot of spidering and text processing in Perl, I had to pass it on to the next generation of students. I gave the code and a document with a quick description of the role of each script and after a week I asked the students if they had questions. They told me they had no questions, they found my code surprisingly readable and could follow it. Well, see, I tried to make it readable and it was, perfectly readable in all its Perl 5 glory ;)

    1. Re:I tried watching the videos mentioned by Megane · · Score: 1

      I just watched them both, and while I think he overdoes it for effect, and some people may dismiss it because it's full of camel memes, he's got some basic points that can't be ignored.

      The language and some of its libraries have implicit unexpected behavior (as opposed to the "nasal demons" explicitly undefined behaviors in C), that just isn't something even a well-experienced programmer would expect from a typical programming language, and even with workarounds, there is still unexpected behavior. Arrays being flattened when creating a new hash or put into parameter lists, CGI modules returning a different basic type of variable when a parameter name is repeated (a concept most people wouldn't think of with CGI in any language), and the intersection of both of those problems. Then trying to work around the problems by writing code that makes an assumption that because it didn't come from CGI, well gosh, the data must be okay! That's a recipe for fail.

      If cgi.pm simply hadn't gone out of its way to do something weird (by default, and I don't know if you can even turn it off) in an unusual condition that most people don't care about, none of this might even have happened. The hash and parameter splicing problems could still be there, but without the chain of fail leading to them, the remote vulnerabilities wouldn't have happened.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    2. Re:I tried watching the videos mentioned by Anonymous Coward · · Score: 0

      I think Netanel is charismatic. And some Perl 5 stuff *is* batshit crazy and he did a good job of zeroing in on that with humor.

      That said, he made basic mistakes in both of his presentations and at least one of the public bugzilla bug reports he filed^1 and has since refused to acknowledge these mistakes, which suggests a lack of technical and professional integrity. I generally expect such behavior from poets, priests and politicians, not someone claiming to be a security researcher.

      ^1 https://bugzilla.mozilla.org/show_bug.cgi?id=1230932 A careless read suggests he found a security bug. A really careless read suggests it was *critical* (his claim). But a careful read reveals it wasn't a security bug at all, was much ado about nothing, and Netanel chose not to acknowledge his mistakes or apologize.

    3. Re:I tried watching the videos mentioned by Anonymous Coward · · Score: 0

      I literally fixed his code for him the second time so that people would try to take him seriously on the merits of his argument rather than worry about the syntactic mistakes he was making. He refused, claiming that his examples were not Perl code, they were pseudo-code.

    4. Re:I tried watching the videos mentioned by Anonymous Coward · · Score: 0

      TL;DR Designers have to make many decisions about various priorities. Perl designers generally prioritize the perspective of programmers who are seasoned and who have read the documentation over a novice's expectations.

      > Arrays being flattened when creating a new hash

              my %lookup-country-by-capital = <London UK>, <Paris France>, <Rome Italy>;
              say %lookup-country-by-capital<Paris>

      The list of lists on the right of the assignment flatten so the second line displays "France".

      I like that. Fwiw I think some novices will be quite happy with it too.

      > returning a different basic type of variable when a parameter name is repeated

      Some Perl module writers have created APIs such that:

      * if a parameter name is only used once, then it refers to a single value and that value is stored in the type of container used to store a single value in Perl (a scalar); whereas

      * if a parameter name is repeated then it refers to a list of values and the list of values are stored in the type of container used to store a list of values in Perl (an array).

      Yes, this may violate novice expectations. No, it is not obvious to me that it would be better to always return a list (array) for every parameter in every case given that in almost all scenarios all parameters are used only once and thus refer to only one value. Do you really want to pessimize the language for almost everyone for almost every use case just to satisfy the unrealistic expectations of some novices?

      > the remote vulnerabilities wouldn't have happened.

      s/wouldn't/didn't/

      Please don't parrot Netanel unless you have carefully investigated his claims.

    5. Re:I tried watching the videos mentioned by Anonymous Coward · · Score: 0

      and poses as a big WTF the fact that it doesn't die on every weird thing he tries. And people in the audience actually find it funny...

      Yeah, he does come off as a big douche bag, to borrow an Americanism. Both his camel memes and hipster clothing/hairstyle kind of scream that. (I didn't mind his accent.)

      I suspect that the audience only finds his WTFs funny because they have not learnt Perl and its semantics, but are expecting it to act perfectly like Python or Javascript or whatever language du jour is -- i.e. their mindset agrees with the presenter.

  25. -Wall by Anonymous Coward · · Score: 0

    Damn - I wanted to ask, what's it like living with all warnings treated like errors?

    1. Re:-Wall by maelkum · · Score: 1

      Quite good, actually. I can't speak for everybody, but I like my code to compile warning-free.

  26. Perfect Sig by goose-incarnated · · Score: 2

    "Software interprets lawyers as damage, and routes around them" - Larry Wall

    --
    I'm a minority race. Save your vitriol for white people.
  27. The Hunting of the Snark by wheelbarrio · · Score: 0

    I understand you're proud of Perl 6: that's great, but I'd be more convinced as a developer or manager of developers to take a deeper look if you could demonstrate with examples how teams of mixed experience and aptitude have built complex, performant, maintainable software with it, rather than throwing ill-judged stones at the competition (the Python and Java comments in particular). There are just so many panes of glass around... and I find myself strangely uncompelled by a cute factorial one-liner. And as roll-my-own guy, I'd be more convinced if you could demonstrate elegance surpassing Haskell or LISP.
    "A last programming language" is a neat turn of phrase that a) is hard to reconcile with the claim that you're "thinking generationally" and b) much like the original TIMTOWTDI motto, though doubtless sprung from your own formidable brain, ironically reads to me like the exasperated marketing department's spin after realizing that "shit, Larry's written another language for Larry".

    1. Re:The Hunting of the Snark by Zero__Kelvin · · Score: 0

      ""shit, Larry's written another language for Larry"

      You hit the nail on the head, and the funny thing is that it used to be true that he openly admitted that Perl was exactly that. This new spin, where he says Perl is a great language for the masses, is in my mind a sell-out of his honesty and ideals. He is brilliant, but his languages are niche languages and no software professional should ever use them unless they can guarantee the only people who will have to work on the software are niche programmers.

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    2. Re:The Hunting of the Snark by doom · · Score: 2

      wheelbarrio wrote:

      I understand you're proud of Perl 6: that's great, but I'd be more convinced as a developer or manager of developers to take a deeper look if you could demonstrate with examples how teams of mixed experience and aptitude have built complex, performant, maintainable software with it, rather than throwing ill-judged stones at the competition ...

      Oh yeah? Well if you're so smart you'd tell us how you managed to avert world war and achieve world peace in our time before you take pot-shots at someone who's software was instrumental the development of the world-wide web, the human genome project, etc...

      I know it's a terrible, terrible thing having to listen to someone say something nasty about Python for once, but you know, perl programmer's like myself have had to deal with several decades of treatment like that, you might just suck it up and keep rolling...

    3. Re:The Hunting of the Snark by wheelbarrio · · Score: 1

      Respect where it's due for Perl's historical achievements - I've hacked enough HGP Perl scripts to know what's what - but they're not per se an argument in favour of using that tool now - any more than the existence of the pyramids are an argument for indentured labour. My problem is (and always has been) that Larry Has Opinions. And lots of those are expressed in such a heavy-handed manner: the language syntax, the intrusive keywords, the proudly gnomic and condescending tone that early on propagated down through Perl user groups, that they are off-putting for anyone that doesn't happen to want to join the club. Which would be a pity if there were no other good options out there, but... there are plenty! And they're not hanging shit on Perl because... why bother? So folks have voted with their feet. Frankly I read a lot of Wall's comments in that interview as the posturing of the second-smartest-kid-at-school. Smart, just not smart enough to shut up long enough for the other kids to get to like him.

    4. Re:The Hunting of the Snark by doom · · Score: 1

      The Death of Perl has been greatly exaggerated. The difficulty of doing useful work with Perl has also been greatly exaggerated. It is nice having folks like yourself come out of the closet on what your Real Problem is... all of that pretense about making astute technical judgements is all a cover for "Larry was *mean* to me!".

    5. Re:The Hunting of the Snark by wheelbarrio · · Score: 1

      Folks like me? No-one in the Perl community was ever mean to me. But I had half a dozen languages under the belt before I had the need for a quick-n-dirty scripting language in the mid 90's and fairly quickly made what I'm happy to this day to call an astute technical judgement that a language and community that was so ostentatiously opinionated would be a risky choice for team work; to say nothing of the languages's technical deficiencies at that time. It wasn't a hard decision. If you want to drive The Homer and gloat online about the fur-lined glove compartment that's fine by me. I'll take the fleet of Camrys and have fun going cool places with the team.

    6. Re:The Hunting of the Snark by doom · · Score: 1

      My problem is (and always has been) that Larry Has Opinions. And lots of those are expressed in such a heavy-handed manner: the language syntax, the intrusive keywords, the proudly gnomic and condescending tone that early on propagated down through Perl user groups, that they are off-putting ...

      You see, this don't sound like a technical dispute to me.

    7. Re:The Hunting of the Snark by wheelbarrio · · Score: 1

      My problem is (and always has been) that Larry Has Opinions. And lots of those are expressed in such a heavy-handed manner: the language syntax, the intrusive keywords, the proudly gnomic and condescending tone that early on propagated down through Perl user groups, that they are off-putting ...

      You see, this don't sound like a technical dispute to me.

      Spoken like someone who's never managed a software development project bigger than themselves.

      Of course it's a technical problem. Why buy into a tool and ecosystem with warts that piss more people off than the next tool's?

    8. Re:The Hunting of the Snark by doom · · Score: 1

      My problem is (and always has been) that Larry Has Opinions. And lots of those are expressed in such a heavy-handed manner: the language syntax, the intrusive keywords, the proudly gnomic and condescending tone that early on propagated down through Perl user groups, that they are off-putting ...

      You see, this don't sound like a technical dispute to me.

      Why buy into a tool and ecosystem with warts that piss more people off than the next tool's?

      Point the first: this is a non-sequitor. Once again, you're trying to claim it's primarily technical issues with the software, and I'm making the point that you just don't like Larry Wall. He's just not *one of us*. Why no gentleman would take swipes at Python's one-true-way.

      If you were actually someone in management, would you listen to someone like yourself? Why?

    9. Re:The Hunting of the Snark by wheelbarrio · · Score: 1

      Point the first: this is a non-sequitor. Once again, you're trying to claim it's primarily technical issues with the software, and I'm making the point that you just don't like Larry Wall. He's just not *one of us*. Why no gentleman would take swipes at Python's one-true-way.

      Ascribing particular states of mind to me might well make your points easier for you to make, but it doesn't make them any good. I don't dislike Larry Wall — I've never met him — although I certainly think he says some silly things, and I don't care at all for the language that he wrote. And although I like Python I haven't used it in my day job for several years now; my workplace is a Groovy/Java/Scala shop.

      If you were actually someone in management, would you listen to someone like yourself? Why?

      Because I understand that despite what you seem to think, the technical challenges involved in language choice for larger software projects are about 1% "does the syntax of language x allow me to do y in this particularly neat way?" and 99% "how many keen programmers skilled in language x do I have/can I attract right now? how quickly can I bring a keen programmer unskilled in x up to speed? how performant, reliable and documented is the core language? how performant, reliable and documented are the 3rd-party libraries available for my problem domain? is there good 3rd party support in the form of testing, build tools, CI, IDE's, profiling tools, version control integration? will my codebase be maintainable by the current crew let alone new hires in 1 year? 5 years? 10?". Honestly if you think Perl is a legit contender in any of those fields against any of the language offerings from Oracle, Microsoft, Apple or Google you really need to get out more.

      In the obvious trivial way all Turing-complete languages are "technically" equivalent in the limited sense that you want that word to mean, so there's really no point wasting time having the argument I imagine you want to have with me that goes like this: me: "oh, but Perl doesn't have such-and-such a feature" you: "of COURSE it does, you just cross the index and middle fingers of your left hand and recite the last verse of Genesis backwards!". I imagine I could have the same argument with a bash guru. FWIW even ignoring the to-my-eye horrendous syntax, the fact that for 25 years Perl evangelists have sung the praises of a language that has had such (ahem) eccentricities as braindead function declarations, lets-have-dynamic-typing-but-also-sigils, bolt-on-OO, a toy REPL, "my this our that" namespacing wtf, awful multidimensional data structures, idiosyncratic libraries ((badly) parsing XML to native datatypes, really?), ugly reference syntax (beating even C++ for homeliness, a miracle!), all the time hilariously making a big song-and-dance about "Easy things are easy" and "the principle of least astonishment" does not to my mind inspire confidence that those folks actually know what any other languages look like. 'Easy' isn't having a character-saving shortcut for some marginal use-case, it's having a language transparent enough that I get excited about the results and not how I got there. And that to me is the kicker - with all the language choices out there now, why are there so few significant new non-hobby projects being started in Perl? Clue... the answer is not "because kids are all stupid these days".

    10. Re:The Hunting of the Snark by doom · · Score: 1

      Because I understand that despite what you seem to think, the technical challenges involved in language choice for larger software projects are about 1% "does the syntax of language x allow me to do y in this particularly neat way?" and 99% "how many keen programmers skilled in language x do I have/can I attract right now? ... "

      What I'm hearing here is you're arguing that the smear campaign worked, you convinced enough of the kids that perl is not bright and shiney, and obviously management should move on to something that is regarded as bright and shiney so they'll have more kids to mess around with.

      The thing that folks like yourself should ask yourself is (1) am I ready to drop my favorite technology when it's no longer the latest fad? (Ruby programmers are going through an awkward phase right now...); (2) when getting a project started, there may be virtues with being fad-compliant, but are you going to tell management to throw it all away and re-write it all when the next fad comes along? (There are *always* guys like that around, everywhere... and many people in management have learned to stop listening to them...)

      ... so there's really no point wasting time having the argument I imagine you want to have with me that goes like this: me: "oh, but Perl doesn't have such-and-such a feature" you: "of COURSE it does, you just cross the index and middle fingers of your left hand and recite the last verse of Genesis backwards!".

      There are features of perl, by the way, that to my knowledge don't exist in any of the competing languages, like full unicode support, including the ability to use regexps to search for characters in a particular unicode character class.

      What I expect to hear in response is: "Oh, that crap doesn't matter." (Uh, Unicode?); And then once the other languages catch up I expect to hear "Look, we have that crap now too!". That's the way it goes in the fabulously rational world of Software Engineering.

  28. Re: #!/bin/perl by Anonymous Coward · · Score: 0

    The discussion was about a specific point in time, so only one of those is applicable.

  29. Re:#!/bin/gaysex by Anonymous Coward · · Score: 0

    ^--- What he sed.

  30. Freindly? by Anonymous Coward · · Score: 0

    Freindly? Really?

  31. Duke Nukem Forever by Anonymous Coward · · Score: 0

    It's apparent that someone asked Larry how it feels to be beat to market by DNF. I'm so glad they did, as I didn't figure I'd ever come across him to do the same. :)

  32. Humble? by Anonymous Coward · · Score: 0

    And here you thought I was a humble guy...

    Can this really be the same Larry Wall who's famous for promoting hubris as a virtue?

  33. Ternary Fail: "??", "!!" by CrashNBrn · · Score: 1
    Something like this:

    X ?? Y ?: Z

    or:

    X ?? Y :? Z

    or:

    X |? Y |: Z

    or:

    X ?| Y :| Z

    Would of made far more sense than to use NOT NOT "!!" as a ternary operator. Even more so since ! (NOT) is valid.

    1. Re:Ternary Fail: "??", "!!" by CrashNBrn · · Score: 1

      On top of that. A significant change to regex syntax??? Who the hell is going to use Perl 6?

    2. Re:Ternary Fail: "??", "!!" by b2gills · · Score: 2

      Considering the Regex code that I see in Perl 6 is easier for me to read than the Perl 5 equivalent. I have more than a decade's worth of experience with the latter, but only a couple years worth in the former. I would definitely say it is worth it.

      I would like to see a conventional regex for JSON that is easier to read and understand than JSON::Tiny::Grammar.

      Everything that was broken deserved to be broken, and was replaced by a much more generally useful feature.

      ( That said there is an adverb that you can add to regexes so that you get the Perl 5 semantics )

  34. Fixing simple errors by Alomex · · Score: 1

    Perl is proven to be fundamentally broken. Here are two very entertaining videos about how to exploit weird array casting, hashes and so on. I really think every Perl programmer should have seen it.

    What do you say about this criticism and the exploited flaws?

    LW: "Doctor, it hurts when I do this!"

    "Well then, don't do that."

    This answer is a cop-out to a clear flaw found in the language. That is, list flattening. There are two basic common errors when implementing your first interpreter. They happen because the natural efficient, elegant, but incorrect solution lead you that way. The errors are, namely, dynamic scoping and list flattening.

    Heck even LISP created by giants of computer science had the dynamic scope error which shows you how easy is to fall in that trap. Dynamic scoping comes from searching in the dynamic environment \pi recursively for the declaration of the given value, instead of searching upwards in the lexical symbol table for the current value. A similar naive representation leads to flattened lists. Trust me, been there, done that myself, both errors. If you design your interpreter cleanly, the code pulls you in that direction.

    Lisp fixed that error early on. Perl creator Larry Wall solution to "break pedal doesn't work" is "stop using the break pedal" (yay car analogy!). Seriously, that is what you have to say about that noob error?

    1. Re:Fixing simple errors by Raenex · · Score: 1

      Lisp fixed that error early on. Perl creator Larry Wall solution to "break pedal doesn't work" is "stop using the break pedal" (yay car analogy!). Seriously, that is what you have to say about that noob error?

      What I take away from Larry's flippant comment: "Don't do that" -> Don't use Perl.

    2. Re:Fixing simple errors by Anonymous Coward · · Score: 0

      This answer is a cop-out to a clear flaw found in the language. That is, list flattening....Perl creator Larry Wall solution to "break pedal doesn't work" is "stop using the break pedal" (yay car analogy!). Seriously, that is what you have to say about that noob error?

      What flaw? The videos and opinions contained therein are BS. I think what Larry is saying is "Don't watch BS videos"

    3. Re:Fixing simple errors by Anonymous Coward · · Score: 0

      And it would have taken too much time to call out each and every bit of BS in those videos. He gave that question as much attention as it deserved (and then some).

    4. Re:Fixing simple errors by Anonymous Coward · · Score: 0

      The video points out the unexpected bug-prone side effects of list flattening.

      You call those videos BS simply because they criticize your favorite language.

    5. Re:Fixing simple errors by Anonymous Coward · · Score: 0

      I call those videos BS because we have different definitions of "unexpected". The videos were made by and for people that don't know perl. I admit that the presentation is likely humorous to someone unfamiliar with perl. And if you play "spot the mistakes in the slides", it can even be funny to someone who does know perl.

    6. Re:Fixing simple errors by Anonymous Coward · · Score: 0

      The videos were made by and for people that don't know perl.

      Sonny, I was writing Perl scripts before you were born.

    7. Re:Fixing simple errors by Anonymous Coward · · Score: 0
      Would you have prefered to break existing code?

      Perl 5 is backwards compatible to Perl 4, which didn't have multidimensional arrays at all.
      So any code that was written in Perl 4 (or earlier) would immediately break when ran with the new version.
      How would you have changed it, considering this was caused by a decision that happened more than 6 years earlier when Perl was just a nicer Bash/Sed/Awk

      You know what is one of the main reasons people continue to use Perl?
      It is that even though new features are added, code that was written years ago and forgot about continues to just work.
      As far as I can tell, the difference between Python 2.7 and 3.* is less than the difference between Perl 5.10 and 5.18 (5+ years).
      It definitely is less than the difference between Perl 1, and Perl 5.24 (28+ years).
      ( It still amazes me that they would break existing code for such minor changes, when Perl has proven that doing so isn't necessary. )

      So again I ask, how would you have fixed it without causing problems for existing users?

      Perl 5 added multidimensional arrays by adding references, which are written by adding a single character to your code.
      Syntax which would have produced an error in earlier versions of Perl.

      Now it could have been "fixed" by adding a pragma which made such code non-flattening, but that would have just moved the problem.
      At that point you would have to add syntax for flattening into outer arrays when that is the desired behaviour.
      I will grant you that is exactly what Perl 6 does ( minus the pragma ), but doing it this way wasn't figured out until last year as part of the GLR (Great List Refactor).

      Other languages flatten similar to Perls before 6. They generally get a pass in part because no-one other than a masochist would write anything webscale with them.
      ( Cue joke about writing Perl for the web is masochistic, because Perl totally wasn't the Duct Tape of the Internet.
      Oh wait it was the Duct Tape of the Internet because it was easier to use for that purpose than other languages of the time. )

    8. Re:Fixing simple errors by Anonymous Coward · · Score: 0
      Well I know for a fact that you weren't writing Perl before I ( different person ), was born (1982) and I absolutely agree to the comment that you replied to.

      Just looking at the slide that has @list on it proves he barely has any knowledge of Perl.
      The fact that he gave the array the name @list, proves that he thinks that it is a list, and that he thinks a list is a data-structure.
      ( Lists are a syntax, and a context, but never a data-structure )
      That slide also shows that it flattens in list context, but he omitted the last value that should have been there.
      ( That is from my memory, and I'm not going to rewatch it because I would probably face-palm so hard that I would knock myself out. )
      I remember there being about 5 or 6 problems with that slide alone.

      If you truly were writing code as long as you say, why didn't you notice those problems?
      I've been programming in Perl for only 15 or so years, and I noticed them immediately.
      ( Also I'm entirely self-taught. While I did take a programming class in High School I learned jack squat there, because I was already programming in a variant of Visual Basic for several years by then. )

    9. Re:Fixing simple errors by Anonymous Coward · · Score: 0

      You can nitpick endlessly on the presentation or focus on its main point and debate that, that is, list flattening is addle brained.

      âoeWhen the wise man points at the Moon, the idiot looks at the finger.â â Confucius.

  35. Europe timezones by dolmen.fr · · Score: 1

    Just one counter example: Lisbon, Portugal is not on the same timezone as Paris, France. WET/WEST vs EET/EST.

    1. Re:Europe timezones by Eunuchswear · · Score: 1

      And if you are in Lisbon you're not in Paris. So "here" could be either Lisbon or Paris, but not both.

      Anyway, the most important point is that any discussion of Perl must result in linguistic nit-picking.

      (I'm a crazy Perl fan. Might like to pick up Perl6 one day).

      --
      Watch this Heartland Institute video
    2. Re:Europe timezones by Eunuchswear · · Score: 1

      Oh, and Paris is not EET/EST, it's CET, CEST (aka Berlin time. This is either for ease of commerce or historical reasons, take your pick).

      --
      Watch this Heartland Institute video
  36. BS by superwiz · · Score: 1

    I stopped reading at Python gives you one way of doing things well. Python's 'yield' allows you to maintain state entirely within re-entrant functions. Which removes a lot of need for classes (as keepers of state of methods). The data-operation duality is much more fluid in Python than it is in Perl. The only reason Perl was ever successful is because it did wild card operations really, really well. Everything else about it is unreadable. Python allows you to have both RAII(with 'with' keyword) and gc-style resource collection. Perl (and I admit that just like everyone else I didn't bother with Perl 6) never had RAII despite living in the networking world, where msg parsing makes it of paramount importance.

    --
    Any guest worker system is indistinguishable from indentured servitude.
    1. Re:BS by Anonymous Coward · · Score: 1

      And perl has anonymous functions with proper closures, so there's very little I need a 'yield' for. But if I do need some variant of a coroutine, there's the Coro library.

    2. Re:BS by superwiz · · Score: 1

      Really? Because combining yield and "with" keyword allows you to have cascading contexts. As in.. use my connection if I have, or some more global connection if I don't, or an even more global connection if that one is not available. And after you are done, if you are the one who created the connection, release it, otherwise let it be. And all of this takes less code and is more clear in Python than the few sentences that I just used to describe it and it has full handling of exceptions at just the right context layer.

      --
      Any guest worker system is indistinguishable from indentured servitude.
    3. Re:BS by b2gills · · Score: 1

      Perl 6 has a similar feature: gather / take.
      ( with Python's yield being roughly the same as take )
      The reason for for the gather is that it requires you to be explicit about where the generator is, unlike Python which is implicit.

      my @even = gather loop { take $ += 2 };
      say @even[^10]; # (2 4 6 8 10 12 14 16 18 20)


      Which in this case would be better written as

      my @even = 2,4,6 ... *;

      Here is another example.

      # note that this isn't a generator on it's own like it would be in Python
      sub roll-die () { take ("\c[DIE FACE-1]".."\c[DIE FACE-6]").roll }

      sub weird-list (){
      gather {
      take 1;
      take my $a = 3;
      take ++$a for ^10;
      roll-die();
      }
      }

    4. Re:BS by superwiz · · Score: 1

      It's not similar. It's unrelated. It has similarity to yield as a statement for producing generators, but not to a single yield from a context manager closure. And this syntax... Sigh. Yes, Perl was good at regular expressions. But then, as this syntax shows, it decide to make everything look like regular expressions. It's unreadable.

      --
      Any guest worker system is indistinguishable from indentured servitude.
  37. wow by superwiz · · Score: 1

    Is he just bitter? He didn't give away his billions to "the people". He essentially gave it to O'Reilly Press. He keeps making statements about Python which are just aren't true. Oh, and as much as I regret it, Python 3 *is* meant to replace Python 2. I like the Python 2 print statement, but such is life.

    --
    Any guest worker system is indistinguishable from indentured servitude.
  38. hahahahahahaha by Anonymous Coward · · Score: 0

    Larry's still at it? The last time I saw a Perl script in production, we had to get the business to sign waivers to absolve us. Sorry man, your Aspergian vision is dead.

    1. Re:hahahahahahaha by doom · · Score: 1

      And they didn't fire you and hire a firm with competent programmers? I guess there's one born every minute...

  39. Re: #!/bin/gaysex by Anonymous Coward · · Score: 0

    AWKward cannot compute.

  40. My theory, which is mine by swm · · Score: 1

    I've thought about this.
    How did a catastrophe like PHP come to be so widely used?
    I've come up with two answers.

    1. Historical accident
    There was a need for a PHP-like language to write web back-ends. It could have been Perl, or Python, or PHP, or Ruby, or probably any of a hundred others. At some point, some language gains critical mass. Then everyone uses it because everyone uses it, and we're off to the races. Which language is first to critical mass is--at least somewhat--a matter of chance. As it happens, it was PHP.

    2. The default behavior of the language processor is to emit the entire program text on STDOUT.
    What this means is that you can take an entire existing static web site--a whole tree of static HTML pages--declare them to be PHP scripts, et voila, there is your web site, just like it was before, except that now you can start adding $variables to your pages and creating dynamic content. It gives managers and salesmen and marketing people and non-programmers a way to get into the game without actually having to do any of that--you know--programming stuff.

    Calling this an easy learning curve misapprehends the situation. It is more in the "this one weird trick" category.

    The actual PHP learning curve is vertical, which is to say, no one can learn PHP. The language is such a tangled mass of inconsistencies, exceptions, breakage and lossage that acquiring the knowledge necessary to use it competently is virtually impossible.

    1. Re:My theory, which is mine by Pseudonym · · Score: 1

      There was a need for a PHP-like language to write web back-ends. It could have been Perl, or Python, or PHP, or Ruby, or probably any of a hundred others.

      Clearly you weren't there.

      Ruby didn't exist. Python may as well not have existed. Unless you had a lot of money to spend, your choices in the web app space were, at the start, SSI or CGI (the back end for which was often Perl). CGI was notoriously slow, and Perl was quite slow to start a script (it was quite speedy once it was running). Yes, mod_perl existed, but it was at its core a mechanism for extending Apache's functionality, not really a system for building web apps/sites in. JSF existed, if you had the computrons to run it and the patience to learn it.

      PHP was really the only thing which just worked in anything resembling an efficient manner, and it worked pretty well for those jobs where SSI wasn't quite good enough. Hosting services installed it by default, and if you wanted anything else, you had to work for it.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    2. Re:My theory, which is mine by Anonymous Coward · · Score: 0

      The reason for PHP's rise.

      The PHP dudes were ambition enough to provide an Apache PHP module. After this innovation, hosting providers could easily allow "Checkbox" enablement of PHP dynamic content. The rest they say is history. There were few competing web technologies that were as easy to deploy. PHP development (and jobs) exploded.

      All this from a guy who despises PHP. I am a Python guy and dearly wish Python had a competing technology that was as easy to deploy as PHP pages for quick 15 minute web sites.

  41. Re: #!/bin/perl by anchovy_chekov · · Score: 1

    Russia has eleven time zones. Russia begins in Europe.

    11? That's ridiculous.

  42. So How Much Wall Time? by tmjva · · Score: 1

    And is there a chargeback method?

    --
    Tracy Johnson
    Old fashioned text games hosted below:
    http://empire.openmpe.com/
    BT
  43. Re: #!/bin/gaysex by mcswell · · Score: 1

    I'd echo that, but the cat's out of the bag.

  44. Re:This is the best thing that's been on /. in yea by whipslash · · Score: 1

    working on it!

  45. Re:This is the best thing that's been on /. in yea by shanen · · Score: 1

    Don't you [whipslash] need a celebrity email system?

    Don't I need a way to spot such interesting articles? PERL is one of my favorite perversions, and I still use Strawberry PERL several times a week. Surprised I never noticed this article.

    Kind of confused, however. On the one hand, you seem to be laying low (which only makes good sense in the absence of that celebrity email system), but on the other hand, you (if you are the source of the newest poll) seem determined to harvest the whirlwind. On the third hand, you didn't ask for any suggestions this time, though I have thought of several improvements to my troll-deterrence suggestion, mostly in terms of making it easier to implement (and more symmetrical) in the slashdot context. On the fourth hand, I still can't help pay for the implementation or ongoing costs of anything in particular (but could only donate in unacceptably general terms), and on the fifth hand I already forgot what hand this was...

    Had to hit the head, which apparently reminded me to suggest Stallman (rms) as an interview candidate. See if you can get him to confess to his cancerous anti-design ideology of anarchism. After all, slashdot suffers from emacs disease, an extreme form of feeping creaturitis. (I've had several email exchanges with rms over the years, and they even contributed to the development of the financial model I've suggested slashdot should consider adding, but mostly I've concluded that he's from a different universe than the rest of us.)

    Now to look at the secret Larry Wall interview...

    --
    Freedom = (Meaningful - Coerced) Choice != (Speech | Beer^2), and sad sock puppets' bad mods avail them naught.
  46. Re:This is the best thing that's been on /. in yea by whipslash · · Score: 1

    What do you mean by celebrity email system?

  47. Re:This is the best thing that's been on /. in yea by shanen · · Score: 1

    Actually I think of it as a kind of dual of the spam problem. What sort of email system would help people who get too much non-spam? Or perhaps I'm just trying to reduce my own tension because I want to react to something that a celebrity had done (usually what an author has written in my case), but I don't actually want to waste their extremely valuable creative time?

    What I would like to receive when I write to such a person would be a robotic reply from their celebrity email system. It would actually return a webform based on the analysis of my email. As I work through the reply I would be able to confirm the analysis (or provide feedback to improve the analysis) while hopefully getting answers to any questions or recording my sentiments for the convenience of the author in question. After getting through the analysis (which would also prove I'm not a robot), then I would be able to submit the form and the answers would be tallied up and I could see how other people feel on the same issues.

    There should also be some meta-options, too. For example, there could be an option to publish my letter on the author's website, preferably 'close to' the letters of people who feel similarly to me. Then we would be able to see the comments and react to them, still without bothering the celebrity. If some part of the website becomes highly active, then maybe that should also be brought to the celebrity's attention. Another obvious meta-option would be to argue for escalation, if the author of the email insists that the email needs more personal attention, but I think this should be deliberately made quite difficult.

    In cases where the celebrity wants to communicate more personally with fans, certain email could be selected for a personal reply. Perhaps a lottery or a vote of other fans for the best email, and the celebrity's reply could be shared widely.

    Anyway, I've written to a lot of authors over the years, and many of them have been kind enough to respond, but I wish I had been directed to a celebrity email system. Not sure about your situation, but slashdot used to be a hotbed of activity--and I noticed that you stayed out of the way after the wasps' nest poll was posted recently...

    P.S. And once again I wish that slashdot were using a financial model such that I could help contribute to the development costs or the ongoing costs (in the case of some authors I admired).

    --
    Freedom = (Meaningful - Coerced) Choice != (Speech | Beer^2), and sad sock puppets' bad mods avail them naught.
  48. Re:This is the best thing that's been on /. in yea by whipslash · · Score: 1

    Good ideas. I'll look into it

  49. Re:This is the best thing that's been on /. in yea by shanen · · Score: 1

    More importantly, why don't you let the members help pay you to look into things?

    Based on my experiences in pitching these ideas over the last few years, it seems to me that the main reason "decision makers" hate the ideas is that they fear loss of control. There are plenty of ways to keep a leash on the mob, most obviously be retaining careful control over the projects that actually get offered for funding.

    --
    Freedom = (Meaningful - Coerced) Choice != (Speech | Beer^2), and sad sock puppets' bad mods avail them naught.