Re: Suggestions on study materials for modern perl web development
by 1nickt (Canon) on Feb 02, 2016 at 11:39 UTC
|
i know and have read somewhere that CGI is no longer part of the standard Perl module distribution that Perl comes with
So what does that mean?
The answer is, it means nothing. CGI is perfectly useful, widely used, well supported, and a good introduction to web application programming.
In the old, old days programmers used CGI's HTML-printing methods to output their script's HTML, often in the main program code. This is indeed bad practice because of the lack of separation between program logic and output presentation, and since almost 20 years it has been recommended to use a different method to output your HTML - Text::Template or the Template Toolkit or Template::Tiny are good choices to explore.
But CGI is an exceptionally well-seasoned package for beginning web application programmers and for experienced developers who need a quick way to build simple interactive sites/pages, and you should not overlook it because of a remark that you read on-line, without understanding what that means. Here's a somewhat recent discussion on the subject.
Having said all that, in regard to the "modern" frameworks, I would say this:
- Mojolicious has a lot of development momentum, is maybe the "hippest" of the bunch (with competition from Dancer2), and you can get started with Mojolicious::Lite if you want a really shallow learning curve (although all these frameworks are relatively easy to learn and begin using).
- Dancer: I use Dancer extensively at $work and find it easy to use and mostly satisfactory, but weak in some areas such as logging. I'm not as familiar with Dancer2 but presumably it tries to avoid some of the weaknesses of its predecessor and is developed by some of the original Dancer devs.
-
Catalyst is the heavyweight of this bunch, with a steeper learning curve and more knobs to twiddle, but with the payoff of a more monolithic application development environment (ie it has more stuff built in).
In any case in your situation I would experiment with building a small test application in each of the above before hitching my wagon to one particular horse.
Hope this helps!
The way forward always starts with a minimal test.
| [reply] |
|
|
Good summary,
If you are interested in why Dancer2 come out you can profit Dancer 2, or Why I Rewrote Everything
Regarding the CGI module, the same page you linked contains the exact chapter explaining why it was removed that contains the following statements:
The rationale for this decision is that CGI.pm is no longer considered good practice for developing web applications, including quick prototyping and small web scripts. There are far better, cleaner, quicker, easier, safer, more scalable, more extensible, more modern alternatives available at this point in time. These will be documented with CGI::Alternatives.
Sounds to me like a more than authoritative opinion.
In the other thread you mentioned i've posted the link to an interview with SayerX where he reports us the Lincol Stein's (the author of CGI) reply to the Cgi must die talk.
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.
| [reply] |
|
|
Hi Discipulus,
I'm familiar with the quotations you cited, but in my view you don't have to read very far between the lines to see that the motivation of their authors is to move readers towards the solutions that they (the authors) favor (and develop).
While there's nothing wrong or sinister about that, it should be seen for what it is, and also for what it is not, i.e. any good technical reason not to use CGI when appropriate.
The way forward always starts with a minimal test.
| [reply] |
|
|
Re: Suggestions on study materials for modern perl web development
by Athanasius (Archbishop) on Feb 02, 2016 at 05:57 UTC
|
| [reply] |
Re: Suggestions on study materials for modern perl web development
by Discipulus (Canon) on Feb 02, 2016 at 08:45 UTC
|
Hello 5plit_func
what i developed in the past it's mere CGI (and watch CGI must die! if you can stand English at machine gun rate..) but i'm interested in perl's web ability and I collected some links about. They are almost all in my chaotic homenode (search for Plack..) but, even better, you have two recent threads about Modern Perl Web Panorama: CGI Alternatives and a threaad with a blaspheme title :=)
I'v done some little initial tests using Dancer (search for version 2 as Athanasius wisely suggested) because seemed to me a little easier to start with (at least in respect to Catalyst).
But another thing were even more important for me to understand: CGI was a specification of a protocol and CGI.pm was it's implementation. A new specification is born in the meanwhile called PSGI.
Plack has also born to implement a suite of PSGI aware tools but read the difference at plackperl FAQ and a short article about these distictions
have fun and reports your findings!
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.
| [reply] [d/l] [select] |
Re: Suggestions on study materials for modern perl web development
by Laurent_R (Canon) on Feb 02, 2016 at 09:54 UTC
|
Web development is not my area either, and the two frameworks mentioned, Dancer and Mojolicious are most probably very good choices, but, only for the sake of relative completeness, I would mention another alternative that you might want to take a look at, Catalyst.
| [reply] |