Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^6: Making Perl Monks a better place for newbies (and others)

by PerlGuy(Tom) (Acolyte)
on Feb 01, 2020 at 18:08 UTC ( [id://11112233]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Making Perl Monks a better place for newbies (and others)
in thread Making Perl Monks a better place for newbies (and others)

"What?". What?

That was A joke.

They say a joke isn't funny if it needs explaining?

The issue regarding having to insert html code for paragraph breaks. I have difficulty understanding why, in a forum run by Perl programmers, I assume, or guess, probably coded in Perl, (I can't do view source on this Android device, but I assume) built by Perl programmers with Perl. such a nuisance issue, or issue about a nuisance exists.

It looks like I'm not the first to bring this up. People have been complaining, and implementing work arounds for what looks like maybe decades. Making templates, and yours. Which I haven't gotten working.

Posting in a forum involves CGI. (I assume I don't have to explain this, but anyway..) "Common Gateway Interface" (not computer generated imagery) Most often, at least in the old days, and, I'm guessing this forum was established long ago... Posts made to any kind of Perl forum were processed with the CGI.pm Perl module which handles the translation of the URL encoding in which the post is sent over the internet back into readable text. Splits on =, Replaces + with spaces and all that.

A post to this forum, or any forum, is sent across the internet URL encoded.

When it is received by the program it is posted to, by the forum, by PerlMonks.org's backend: (alert! URL coded text ahead)

text=The+program+receives+the+text+URL+encoded+which+
looks+like+this+text+here.+Spaces+are+%2B+plus+signs
+and+special+characters+are+changed+%23%24%40%26%2B-%25*
+like+that

CGI.pm puts it (the URL encoded text) back to normal. So it can be read.

In most forums, newline character, (the return for paragraph breaks) which don't render in html are converted to html paragraph breaks or BR or something so that they do.

I would assume the reason this hasn't been fixed long ago, is because the "gods" are just having some fun. Certainly it's not because nobody knows how to do a substitution. It must be some kind of joke right?

So I got to thinking, if we are going to NOT do the substitution to change the text input newline to html paragraph or line breaks. If someone thinks that's such a gas, well it would be loads more fun if we didn't bother with reversing the URL encoding either. (Try reading the following)

text=Then+all+the+posts+in+here%2C+besides+not+having
+paragraph+breaks+to+make+posts+harder+to+read+and+be+a+royal+
pain+in+the+ars%27s+the+URL+encoding+wouldn%27t
+be+striped+either+and+we+could+have+fun+trying+to+fix+that+
without+access+to+the+server.+What+fun+right%3F%3F%3F

In other words, the text is going through a lot of processing anyway, on the server, to strip out the URL encoding, perform split and do replacements. Text processing is what Perl excells at. Why not be processing paragraph breaks to be what they are or should be? It's not dangerous.

Tom

Replies are listed 'Best First'.
Re^7: Making Perl Monks a better place for newbies (and others)
by marto (Cardinal) on Feb 01, 2020 at 19:20 UTC

    "Posts made to any kind of Perl forum were processed with the CGI.pm Perl module"

    Perlmonks uses a fork of the everything engine. In case you don't know, CGI.pm isn't core and hasn't been a sane choice for web development for a long time. See CGI::Alternatives.

      This?

      Sorry, there was a typo in the link. Fixed now.

      https://sourceforge.net/projects/everydevel/

      Considerably modified for PerlMonks, I suppose.

      The project website is, something else now. No project activity in 5 years, apparently.

      Elsewhere in the forum, someone says it is "hard to get into". Is it compiled?

      I may download "everything engine" just out of curiosity. Don't know if anything can be done with it.

      Is it possible to install on a shared host?

      Dependencies? My web host will not install additional modules, but I can do a Perl dive and see what's there.

      Would there be any point?

      If there is some reason for keeping this, Maybe I'd agree, but I would prefer to focus on what I'm writing instead of having to deal with html formatting for every post, more than one paragraph.

      Tom

        PerlMonks does use CGI.pm. It's a fork named Everything::CGI.

        Development of the PerlMonks engine diverged from Everything a long time ago. I'd estimate about 20 years ago. There has been some porting of features back and forth over the years, but very little. My point is that studying the Everything Engine you download now will only give you the most general gist of how PerlMonks works.

        If you like, I can add you to the PmDev group so you can start looking at the code here.

        I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.

        "Would there be any point?"

        No.

      I did know CGI.pm was depricated. I would imagine text processing still goes on in more or less the same way somehow, somewhere.

        If you have the time I'd strongly recommend looking at the Mojolicious framework. It makes dealing with the modern interwebs a joy.

Re^7: Making Perl Monks a better place for newbies (and others)
by Anonymous Monk on Feb 01, 2020 at 18:24 UTC
    Legacy code and mass of data in old format
      I thought of that, but, such a change would not alter anything already rendered and posted on the site. I don't think.

      Workarounds, like a template might have to be changed, or might no longer be necessary. But nothing already on the forum would be altered.

      I can't see how anyway.

      Tom

        That's because you have no clue how it works.

        Posts are rendered into "real" html at page display time by the Engine, which expects the node source content to be in our special su{b|per}set of html.

        We now have well over one million nodes in this format in the database.

        No transformation is done to user-posted content at input time.

        Ponder that for a while. Then please provide your ideas. The challenge is not insurmountable, but one must begin from an informed position.

        A reply falls below the community's threshold of quality. You may see it by logging in.
      Its got nothing to do with that
        With what?

        Or/and: What does it have to do with?

        I've written some basic message board programs, going back to the 90's. I would think not having basic functionality, such as rendering basic text with paragraphs,, would be intolerable.

        I can live with it I guess, I'm just puzzled why we have to, or why anyone would want to.

        Tom

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11112233]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-03-28 20:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found