in reply to Re: Building a webpage with Perl
in thread Building a webpage with Perl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Building a webpage with Perl
by marto (Cardinal) on Apr 08, 2011 at 13:39 UTC | |
IMHO it's important to understand the fundamentals of what's involved, such as getting basic scripts running, security concerns etc. Your post mentions frameworks and database interfaces (which may be overkill depending on what the exact requirements are), while these are great tools to use threats such as SQL injection and XSS are issues which developers should be aware of. IMHO Ovid's guide is a great introduction to CGI, user input and security (while also providing links to further reading). Lest we forget Little Bobby Tables or the recent lizamoon fiasco. | [reply] |
by tospo (Hermit) on Apr 11, 2011 at 08:31 UTC | |
I'm a bit surprises about the - in my view - slightly excessive downvoting and I think it would be good if those who did downvote could explain why? Not because I'm too fuzzed about XP but because I would really like to know if others really disagree with the notion that a pure CGI script as back-end for a web-app is a bit dated, in particular if the web-app basically handles a database with forms for viewing and updating records. I mentioned database interfaces because the OP described a scenario where a CSV file would basically be used as a database - including update operations. To my mind, this is going to be highly problematic in the long run and I'm not sure if your post agrees or disagrees with that position(?) | [reply] |
by marto (Cardinal) on Apr 11, 2011 at 10:02 UTC | |
Let me address what I can. You said: "It's certainly good to learn the basics but I think this tutorial is a bit dated now." then "I don't disagree with you at all. As I said, it's a great tutorial for the fundamentals and the securtiy considerations are of course important still but I think it is also true that there are more recent approaches to writing web-apps and I would recommend exploring those." Personally I think the tutorial in question is pitched at exactly the right level for someone new to CGI. I can't think of a better freely available online resource that is comparable, which isn't so say one doesn't exist. The fundamentals/security know how is important regardless of using plain old CGI or a framework. Should they want to move on to using one of the many frameworks available there are plenty of resources devoted to each specific one, and some providing comparisons between them. IMHO that's another learning curve, over and above (rather than instead of) learning what is taught in the tutorial I linked to. Essentially I believe in using the right tool for the job. Depending on what exactly is going on a framework may be overkill, where a simple stand alone CGI script or something like this may be all that's required. "I mentioned database interfaces because the OP described a scenario where a CSV file would basically be used as a database - including update operations. To my mind, this is going to be highly problematic in the long run and I'm not sure if your post agrees or disagrees with that position(?)" My post made no comment regarding the database aspect, again depending on the exact requirements I'd probably move away from a csv based database. By the sounds of it DBD::SQLite would be more than suitable for this task. | [reply] |
by davies (Monsignor) on Apr 11, 2011 at 11:19 UTC | |
Well, I didn't downvote you, but I will offer my wild guess at why you were downvoted. If you see this node in Worst Nodes, you will know I was wrong! You criticise a tutorial as being "dated". BUT ... Regards, John Davies | [reply] |
by tospo (Hermit) on Apr 11, 2011 at 13:34 UTC | |
My only intention, really, was to point out to the OP - someone who is obviously just starting on a first web app - that the one-cgi-script web-app may not be the lastest development in this area and that she/he should - IMHO - look into some more recent suggestions of how this problem can be tackled. I did suggest (earlier) some alternatives that I am using myself. Yes, frameworks come with a bit of a learing curve too but I see a clear danger for the OP to end up with an ever-growing cgi-script that tries to handle this CSV file database. That is why I suggested CGI::Application, which doesn't move away too much from "traditional" Perl CGI while making it easier to maintain some structure in the code. I also think it should be ok to express the opinion that something may be outdated and I think it's equally ok to point out why it isn't or what aspect of it aren't. I don't think that is the same as just being negative. Great tutorials and books have been written in the past but it is often difficult for the beginner to see how up-to-date these are, even if it is clear when they were written. Anyway, enough said and I think there's enough information here now to get the OP started (or confused... :-) | [reply] |