8 ms·
There are also a lot of things about Perl that prevented new developers from choosing it when other options were available. I learned Python from reading a poc
by danudey 11mo ago
There are also a lot of things about Perl that prevented new developers from choosing it when other options were available.
I learned Python from reading a pocket language reference that just described the syntax and standard library, because the language was simple and easy to understand and everything made sense.
Conversely, I was trying to debug a script someone else ran and came across a line that said '$|++'; it was impossible to search for on the web, and when I asked on IRC the only answer I got was 'man perldoc' which also did not answer my question in any reasonable way.
For anyone wondering: `$|` is an alias for `$OUTPUT_AUTOFLUSH`; it defaults to 0 (line-buffered) but any non-zero value means 'flush output immediately'. Thus '$|++' changes 0 to 1 (or 1 to 2, etc), which means that '$|++' means 'turn off output buffering'. No one could be bothered to say that; if you had questions about the language you clearly didn't RTFM well enough so that became the default/only answer I ever saw.
Meanwhile, the PHP community was often welcoming and helpful to newcomers, despite most of them being bad at programming and giving bad advice, and the Python community produced a language that was so often self-explanatory that new user questions were more about how Python did things or asking about how to implement things they didn't realize were in the standard library.
So yeah, lots of things contributed to Perl's decline, but the community being a bunch of elitist toxic dicks sure didn't help matters and it meant that as the set of people looking to learn how to do programming on Linux grew past the neckbeards looking for any metric to show that they were better than other people then Perl's growth potential was finite.
- sltkr 11mo ago> when I asked on IRC the only answer I got was 'man perldoc' Your overall point notwithstanding, this was just bad advice. What you want is `man perlvar` (or equivalently `perldoc perlvar`) which documents this and other predefined variables: HANDLE->autoflush( EXPR ) $OUTPUT_AUTOFLUSH $| If set to nonzero, forces a flush right away and after every write or print on the currently selected output channel. Default is 0 (regardless of whether the channel is really buffered by the system or not; $| tells you only whether you've asked Perl explicitly to flush after each write). STDOUT will typically be line buffered if output is to the terminal and block buffered otherwise. Setting this variable is useful primarily when you are outputting to a pipe or socket, such as when you are running a Perl program under rsh and want to see the output as it's happening. This has no effect on input buffering. See "getc" in perlfunc for that. See "select" in perlfunc on how to select the output channel. See also IO::Handle. Mnemonic: when you want your pipes to be piping hot Also, `man perl` gives a great overview of the extensive number of Perl-related manpages. I think any person that starts from `man perl` will be able to answer a lot of their questions, but part of the problem was that around the millennium, people stopped reading man-pages, and started looking for information on the web. perl was one of those old-school tools that were documented extensively in man-pages, but past 1995 ~nobody bothered to read man-pages anymore.
- chuckadams 11mo agoThat variable in particular gets covered in the Llama book as well. Anyone serious about learning perl in the 90's had at least one of the Camel or Llama books.
- worik 11mo agoGolly There, the problem illustrated "You are not serrious" is a downright hostile attitude "man perldoc" as an answer can be translated as "f*^&%k off you stupid...."
- deleted 11mo ago[deleted]
- broken-kebab 11mo agoman perldoc is too curt, and therefore may feel hostile especially for native English-speakers who are used for polite communication to be more wordy. But cultural things aside it's actually a good working solution.
- chuckadams 11mo ago> f*^&%k off Hey you're writing perl already! ;) Sorry for being salty earlier, but learning a language still takes at least a day or two of solid reading of the official manuals. https://perldoc.perl.org https://perldoc.perl.org if you want a web version.
- debtta 11mo agoThis is exactly the point. There was a fifteen year period where the best way of finding out what something meant in a programming language was to Google it. Pre-AI, post the predominance of newsgroups and offline documentation. Try googling "$|++". It just doesn't work. Never has. Now Google "file.flush". First hit is the answer you need on SO.
- 11mo ago
- broken-kebab 11mo agoSorry for the bad experience you had, I believe it's always better to be kind to strangers on those global nets. But TBH perldoc would really work very well for you.
- rcakebread 11mo ago> the only answer I got was 'man perldoc' When I asked a question on the PERL Usenet group in the 90s, I used the word "newbie" to describe my skill level. I got an automated email explaining why I shouldn't use that word.
- DonHopkins 11mo agoThis is so spot on. You can't google line noise, and that mattered before LLMs. And everything else you said.
- creer 11mo agoPerl was not and still is not suitable for people who refuse to read the manual or tutorial. Perl had and still has truly AMAZING documentation (and far better in perl 5 than Perl 6 - where the documentation's search function is regularly broken for example). And out of this world bring-up tutorials. But if the bar is at "I want to be up to speed after reading a short booklet" - well, that's not gonna work. For me I have programmed in perl for decades and I still get the occasional deep plunge in a feature area that I never used before... And the various docs and books still come through. On top of that, Perl 5 had an amazing community ready to help - but understandably annoyed with constantly re-quoting the AMAZING documentation. It could have gone either way, it just went the way it did: experts present and ready to answer. But there too - if you expect the community to constantly answer the most basic questions, well, Perl was not for you. As a tradeoff perhaps, that expert community also spent a lot of effort on the AMAZING module library. Perl 5's thorough documentation, plus splendid course book, plus all the books, plus CPAN, PLUS the expert help producing fantastic rabbit holes to learn more about your PROFESSIONAL MEDIUM. THAT was the reason for choosing perl. If anything, newcomers don't go to the documentation because they are not aware that documentation can be THAT good. That was, still is, a marketing error.
- bombcar 11mo agoThat's an interesting observation - and my recollection is that the perl heyday was just about before the Googlefication of the world; certainly before stacked overflowing. Grab a snippet of Java or Python and you can google it pretty easily, grab some line noise from perl and you would first need something to translate it into idiomatic text - search engines would search for "OUTPUT_AUTOFLUSH" but would often discard things like "$|++" I remember learning my use of perl from a red book - probably "Perl 5 by Example" - everything was in books back then, and you read them. Now you learn programming via searches and LLMs, so the languages that win going forward are going to be the ones optimized for that.
- inejge 11mo ago> search engines would search for "OUTPUT_AUTOFLUSH" but would often discard things like "$|++" Out of curiosity, I tried perl "$|" in DDG and Google. DDG returned nothing, but Google led with "perl $|=1; What is this?", and "Perl, what does $|++ do?", both from Stack Overflow. Search like it's 2014, eh? I don't have a time machine, but I'm pretty sure that quoting would've worked ten years ago, too.