Remix.run Logo
sltkr 4 hours 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.
broken-kebab 4 hours ago | parent | next [-]

Let me respectfully disagree.

  man perldoc
would tell one needs to use -v key to learn about a var. And consequently

  perldoc -v '$|'
would tell everything one needs to know about $|

So it was actually reasonable advice.

bawolff 4 hours ago | parent | next [-]

RTFM might be reasonable advice, but its not "welcoming" advice.

maxlybbert 3 hours ago | parent | next [-]

I remember being very enthusiastic about helping people on, say, Stack Overflow. It didn’t take much extra effort to be nice and made me happy.

But I also burned out relatively quickly. I’d happily answer new questions nicely, but the third or fourth time I saw the same question I spent much less effort to give a welcoming answer than I had the first time I saw it.

Of course, getting the same question repeatedly may suggest something should be redesigned.

I don’t know any good way to keep helpful volunteers helpful for a long time. The best idea I have is constantly recruiting new experts to continually replace the ones that burn out and chase off newbies.

creer 36 minutes ago | parent [-]

> getting the same question repeatedly may suggest something should be redesigned

Yes! There was a lesson in that and we all missed it. That was probably one of the failings of perl. It ran into a generation of people who never knew about "man pages", or couldn't read (jk - but only somewhat: for some people reading is very hard because various flavors of ADHD, dyslexia, executive disfunction, whatever) and the man page is then useless, or went to google first and '$|++' failed (because google was raised on python).

Better marketing of the documentation would have helped.

I would say "we'll do better next time" but then perl 6... I'm not happy with perl 6 documentation. There is a lot of it - no problem there. But it insists on living online which necessitates a hosted search function. Which is always broken.

kstrauser 41 minutes ago | parent | prev | next [-]

Yep, especially when so many instances of TFM were awful. Perl's docs were fantastic, or so at least I thought at the time, but they were the first large open source project docs I devoured. I can imagine someone coming from another language not even considering just looking at the man page because they were used to awful documentation.

broken-kebab 4 hours ago | parent | prev | next [-]

I agree in general (and already commented on this). But some people believe it's like giving fish instead of fishing rod. And I think it was prevalent idea in tech circles during 90s-00s that people who don't read that fm waste other participants time, and needlessly multiply forum topics or extend conversation history. Which was seen as uncivil behavior in those times.

cestith 3 hours ago | parent | prev [-]

If they specified ‘perldoc -v $|’ instead of just ‘man perldoc’ I’d have been thankful for that as the entire response. It’s literally a pointer to where the answer is and to how to use the canonical tool to find it.

sltkr 4 hours ago | parent | prev | next [-]

Fair enough, but I think the first part of the advice would be a lot more helpful if it included the second part too. It's the intermediate step that turns people off: why do I need to learn about `perldoc` when I asked about `$|`? (And that's assuming the question asker is familiar with man-pages to begin with, otherwise, you need to read `man man` first!) It feels like you're sending them off on a wild goose chase, even if that's not your intent.

In the millennial web forum world, a n00b would ask "what does $| do?" and the answer would be "it disables output buffering", which is what the n00b wanted to know in the first place. It's the Stack Overflow model of giving men fish, instead of teaching them how to fish.

And in today's LLM-powered world that's only more true. If you ask ChatGPT "In a Perl script, what does $|++ do?" it will immediately give you a correct and concise answer, not make you read `man perldoc` first.

broken-kebab 3 hours ago | parent [-]

Yes, it would look and work better if presented with an explanation like "you can find any var description by using...". But as I commented already in another thread there was a widespread belief in 90s-00s that users who ask about already documented pieces are being uncivil, not vice versa. So it's not about Perl community per se. The same was norm in many Linux fora, for example.

chabska an hour ago | parent | prev | next [-]

How would I know that $| is a var? It could be an operator, or a function, or a directive.

knowitnone3 an hour ago | parent | prev [-]

so they should have written that. Next you're going to tell me man man is reasonable advice

chuckadams 4 hours ago | parent | prev | next [-]

That 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 4 hours ago | parent [-]

Golly

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...."

creer an hour ago | parent | next [-]

A professional medium might have been gate-kept being paying coursework. Perl was not: the super-complete documentation was right there, in the distribution; the remarkably intelligently written course book was right there on everyone's shelves and in your local public library; the in-depth books same thing; And quickly enough even free on the net; the expert-built module library was all there to use and study; the experts were giving their time freely, writing deep dive articles at the simple prompt of worthy questions in addition to columns on topics which I guess were not getting enough questions.

For a professional medium, the only lack that I can tell is from a marketing point of view: installing the distribution for example, probably did not highlight enough how extensive the documentation was.

chuckadams 3 hours ago | parent | prev | next [-]

> 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 if you want a web version.

debtta 2 hours ago | parent [-]

This 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.

creer an hour ago | parent [-]

You did not need to google anything. The complete documentation was right there, next to the interpreter, on your machine. Ready for scanning and reading from top to bottom; and broken in sections that were actually relevant; and ready to search in bulk if you prefered with whichever local search tool you cared for.

No need for google. (And google was run by python fans; probably saw no need to support searching for '$|++'.)

idop 3 hours ago | parent | prev | next [-]

I disagree, at least when it comes to the web (of those days). What's the point of rewriting what's already well- and accurately-written in the docs? What better job are the people on that message board going to do with regards to such a small, specific syntax feature? The point of those "communities" wasn't to answer questions like "what is this variable?" but rather to have actual discussions on the language, such as how to structure applications, design patterns, projects, etc. Imagine trying to build an online community for this purpose, only to spend your days answering the most basic questions possible that were already explained many times before.

Eventually, a website more tailored to such questions was created - Stack Overflow - and there things were very different than in subject-specific communities: there was no "community", there were no discussions, just a big mess of questions. It had a purpose and it served it well. Now it's dying too because of LLMs, but I digress.

Now, in a different scenario, say a colleague asking you that question at work, a direct answer is warranted, but without letting the colleague know that this information and a lot more is a just a few keypresses away would be a wasted opportunity, and not particularly a good way to help that colleague progress.

You can only spoon feed people so much. At a certain point relying on other people to just give you the answer every time you don't know something is lazy. It's like you have no respect for their time.

broken-kebab 4 hours ago | parent | prev | next [-]

  man 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.
4 hours ago | parent | prev [-]
[deleted]
throwaway173738 4 hours ago | parent | prev | next [-]

This comment kind of epitomizes the way the Perl community works, to be honest.

gosub100 4 hours ago | parent | prev [-]

The problem is with man pages themselves. You shouldn't have to read 100% of something to find 0.1% of something. In fact, this concept is covered extensively in CS theory about sorting. Reading a manpage is less efficient than asking someone who already knows.

creer 42 minutes ago | parent | next [-]

The man pages were broken into competent sections over multiple man pages. About 260 of them on this machine (not really: there is a change-tracking man page per release recently.) The 1st man page is an very compact index to them.

After that, each section is long but very searchable.

But I can see how many people never even noticed."Man page? what's that? what for?"

jwillp an hour ago | parent | prev | next [-]

The trick is to already know how to use regexes to make searching the manpages easier! But you really have to nail down the rules for escaping when you want to search for perl's gnarliest sigil magic.

broken-kebab 3 hours ago | parent | prev | next [-]

There are some manpages which are too long, and cumbersome but it's not a widespread problem I believe. In particular man perldoc is laconic and on point.

I don't think that RTFM is the best form to answer, but those who auto-reject "man" as an answer are definitely missing something important

thyristan 3 hours ago | parent | prev [-]

Only locally, only for you, and only short term. You are wasting the time of the person you are asking, and you are learning absolutely nothing about the context of the answer. When the next question arises, you won't even know where to look, you will only continue wasting other peoples' time.