Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: plack psgi

by erickp (Sexton)
on Feb 09, 2023 at 16:32 UTC ( [id://11150269]=note: print w/replies, xml ) Need Help??


in reply to plack psgi

Guys, maybe I'm not going about it the right way, seems like I am not from some of your comments, I get it.

Here's the why and what I'm after :

- I've been coding web stuff on and off since 1847, went from ASP to Java to PHP to Wordpress and now I'm trying Perl. Yes I'm a late bloomer it seems.

- I'm used to the way of simply inserting tags of code in html, like PHP or ASP or JSP etc...that's what I gravitate towards to naturally. That's how I've learned. I like that concept, even if some folks hate the fact of mixing logic and presentation together. I shamelessly don't find that to be an issue for me, makes it actually easier for me. I like it.

- I am NOT used to the "new" way of doing "apps" like what is done in nodejs-type languages. To me Mojo, Dancer etc. are all in that same vein. It's not that I'm against it, I just don't prefer that way of working from the get go, not familiar to me. I like the familiar.

- Also, doing something lower level (psgi/cgi) for me is also a way of learning how things work under the hood, I like that. Yes there are "security" risks for me in doing so. I don't mind burning myself while learning how to code securely. To me that's part of learning how to do things right. Why do you think the creator(s) of Mojo or other frameworks created their own in the first place. The argument that something else already exists wasn't an option for them either. People never think they should re-invent the wheel, until they do, every 10 years or so.

- Basically I just love the Perl language and I'm trying to learn it as "vanilla" as I can for now. I was just going to use CGI.pm but then learned about psgi so...I'll start with that. Perhaps in 2 weeks I'll come to my senses and use a "real" framework, who knows!

Again, not bashing the "other" ways of working or other frameworks. I just try to stick to concepts I already know if I can, better for my aging brain.

Thanks.

Replies are listed 'Best First'.
Re^2: plack psgi
by marto (Cardinal) on Feb 09, 2023 at 17:03 UTC

    I'm used to the way of simply inserting tags of code in html, like PHP or ASP or JSP etc...that's what I gravitate towards to naturally. That's how I've learned. I like that concept, even if some folks hate the fact of mixing logic and presentation together. I shamelessly don't find that to be an issue for me, makes it actually easier for me. I like it.

    I started with ASP and ColdFusion, I'm happy to report that Mojo allows you to include perl code in templates (containing HTML/JS etc). Guides -> Embedded Perl. You'll find this familiar.

    I appreciate what you're saying with the remainder of your response. There's validity in the point you make about reinventing the wheel, from the Mojo homepage:

    "Mojolicious is a fresh take on Perl web development, based on years of experience developing the Catalyst framework, and utilizing the latest web standards and technologies. "

    If you change your mind, I'd suggest getting started with Mojolicious:::Lite, (Tutorial), you get to keep it simple in terms of the organisation of your code, and get great benefits provided by the framework, and I honestly think the learning curve isn't particularly steep given your past experience. With this in mind the responses to Switching from PHP to Perl/Mason from a few days ago are perhaps more along the lines that you're thinking of now.

    Update: derp, you created the previous thread...

      Thanks for the response! Appreciated!
Re^2: plack psgi
by Discipulus (Canon) on Feb 10, 2023 at 09:02 UTC
    Hello erickp,

    > I've been coding web stuff on and off since 1847

    Please dont change this typo (hoping this is typo ;) because it made me laugh a lot and saved my friday morning in a boring office.

    In exchange I offer you some, maybe interesting, link from my bibliotheca about plack, psgi, migrating from CGI and web programming in general.

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
      Might be not a typo, but simply meaning "since the year dot".
      What does this have to do with Abraham Lincoln?
      Everything.
      After all, it was he who proclaimed on June 2, 1861, that “The problem with information that you read on the Internet is that it is not always true.”
      -- (Source)
      Thanks Discipulus.
      You forgot to close italics over there
Re^2: Template / plack psgi
by Bod (Parson) on Feb 10, 2023 at 23:41 UTC
    I'm used to the way of simply inserting tags of code in html, like PHP or ASP or JSP etc...that's what I gravitate towards to naturally

    Others have suggested Mojolicious and I will throw Template in as a suggestion. It handles all the display for you through templates (there's a surprise from the name!) but without changing the underlying Perl language.

    If you want to include Perl in your templates you can - either as a sub which the template calls or directly embedding the Perl.

    I'm not a user of Mojolicious so I may be mistaken, but it seems to me that Template is easier to learn if you already know Perl. I have certainly not found anything I want to do with web and email programming that Template cannot handle. I think it was hippo who introduced me to Template - for this I will be grateful to the end of my days...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-25 17:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found