I'm not a web guru nor a Perl one, but i have used CGI.pm a lot in the past and i still maintain a little portal using it.
I feel the need to upgrade to something modern, because there are a lot of good alternatives. But as always speacking of Perl web dev, there is a little misunderstanding.
There is the protocol and there is the implementation. I suppose that the protocol is dead as idea, but the implementation can be usable, in very short, protected env. As you have shown. I also consider it still valid as html spawner:
use CGI qw /:html/;
my $q = CGI->new;
print $q->redirect( 'http://www.perlmonks.org');
Anyway there are valid reasons to consider CGI dead: look at
SawyerX condamning it:
CGI.pm must die! and again
SawyerX in the interview
where he tells about a Lincoln Stein's answer to the previous talk. As SayerX (coauthor of
Dancer) said, i'm thankfull to Lincoln Stein, but we lost a lot of time and now we have to look forward:
PSGI is the new protocol and
Plack it's implementation.
Notice also, even if i agree with you about CGI as still good module, in the official doc of the module is stated clearly:
CGI.pm HAS BEEN REMOVED FROM THE PERL CORE
..
The rationale for this decision is that CGI.pm is no longer considered
+ good practice for developing web applications, including quick proto
+typing and small web scripts. There are far better, cleaner, quicker,
+ easier, safer, more scalable, more extensible, more modern alternati
+ves available at this point in time. These will be documented with CG
+I::Alternatives.
More on we are told to not use html generation, too...
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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.