Editing
Portal:Perl CGI Programming
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
Most of the web-based perl work out there are long-standing small to medium size businesses whose stack is a combination of batch scripts/crons and CGIs. The primary concerns are usually around adding modern features, or modernizing to PSGI, better templating engines and so forth. In general you won't do well if you don't have a strong understanding of the major database engines, javascript, CSS and HTML. Tips & Tricks: * CGI::Emulate::PSGI::emulate_environment - CGIs always rely on ENV, and PSGI doesn't set that for a variety of good reasons. * It is a common practice to feed raw requests into CGIs via stdin to rescue things like failed form submissions that get dumped somewhere. You'll have to build a shim. * The use of require() rather than use is very common in CGIs, as startup time is the enemy there. You'll have to hunt all that down to improve performance and stability. * Most PSGI servers are a preforking worker model. Reliance on global vars in packages set during BEGIN and other non-reentrant practices will almost certainly get you in trouble. * You'll almost certainly want to move away from CGI.pm HTML builder subs and into a templating engine. Text::XSlate using the TTerse dialect (template toolkit) is usually what you'll want to reach for. * Deploying code is a bit different than in CGI; you'll have to send SIGHUP to the PSGI server (most on cpan support this). That will instruct the server to gracefully reap the workers without dropping in-flight requests. Specific Features: * To add 2FA, use TOTP. Recommended module is Trog::TOTP, it avoids edge cases present in all other options and performs better. * To add URL shortening without using external services (useful for things like Emails), use URI::Shortener.
Summary:
Please note that all contributions to Perl Guilds - Getting Medieval with Perl may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Perl Guilds - Getting Medieval with Perl:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Tools
What links here
Related changes
Page information