<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.perl-guilds.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=GeorgeBaugh</id>
	<title>Perl Guilds - Getting Medieval with Perl - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.perl-guilds.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=GeorgeBaugh"/>
	<link rel="alternate" type="text/html" href="https://wiki.perl-guilds.net/index.php?title=Special:Contributions/GeorgeBaugh"/>
	<updated>2026-05-01T10:21:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.perl-guilds.net/index.php?title=Portal:Perl_CGI_Programming&amp;diff=162</id>
		<title>Portal:Perl CGI Programming</title>
		<link rel="alternate" type="text/html" href="https://wiki.perl-guilds.net/index.php?title=Portal:Perl_CGI_Programming&amp;diff=162"/>
		<updated>2025-01-24T18:42:57Z</updated>

		<summary type="html">&lt;p&gt;GeorgeBaugh: deploying psgi&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
&lt;br /&gt;
The primary concerns are usually around adding modern features, or modernizing to PSGI, better templating engines and so forth.&lt;br /&gt;
&lt;br /&gt;
In general you won&#039;t do well if you don&#039;t have a strong understanding of the major database engines, javascript, CSS and HTML.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Tips &amp;amp; Tricks:&lt;br /&gt;
&lt;br /&gt;
* CGI::Emulate::PSGI::emulate_environment - CGIs always rely on ENV, and PSGI doesn&#039;t set that for a variety of good reasons.&lt;br /&gt;
* 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&#039;ll have to build a shim.&lt;br /&gt;
* The use of require() rather than use is very common in CGIs, as startup time is the enemy there.  You&#039;ll have to hunt all that down to improve performance and stability.&lt;br /&gt;
* 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.&lt;br /&gt;
* You&#039;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&#039;ll want to reach for.&lt;br /&gt;
* Deploying code is a bit different than in CGI; you&#039;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.&lt;br /&gt;
&lt;br /&gt;
Specific Features:&lt;br /&gt;
&lt;br /&gt;
* To add 2FA, use TOTP.  Recommended module is Trog::TOTP, it avoids edge cases present in all other options and performs better.&lt;br /&gt;
* To add URL shortening without using external services (useful for things like Emails), use URI::Shortener.&lt;/div&gt;</summary>
		<author><name>GeorgeBaugh</name></author>
	</entry>
	<entry>
		<id>https://wiki.perl-guilds.net/index.php?title=Portal:Perl_CGI_Programming&amp;diff=159</id>
		<title>Portal:Perl CGI Programming</title>
		<link rel="alternate" type="text/html" href="https://wiki.perl-guilds.net/index.php?title=Portal:Perl_CGI_Programming&amp;diff=159"/>
		<updated>2025-01-24T18:37:38Z</updated>

		<summary type="html">&lt;p&gt;GeorgeBaugh: Basic information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
&lt;br /&gt;
The primary concerns are usually around adding modern features, or modernizing to PSGI, better templating engines and so forth.&lt;br /&gt;
&lt;br /&gt;
In general you won&#039;t do well if you don&#039;t have a strong understanding of the major database engines, javascript, CSS and HTML.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Tips &amp;amp; Tricks:&lt;br /&gt;
&lt;br /&gt;
* CGI::Emulate::PSGI::emulate_environment - CGIs always rely on ENV, and PSGI doesn&#039;t set that for a variety of good reasons.&lt;br /&gt;
* 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&#039;ll have to build a shim.&lt;br /&gt;
* The use of require() rather than use is very common in CGIs, as startup time is the enemy there.  You&#039;ll have to hunt all that down to improve performance and stability.&lt;br /&gt;
* 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.&lt;br /&gt;
* You&#039;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&#039;ll want to reach for.&lt;br /&gt;
&lt;br /&gt;
Specific Features:&lt;br /&gt;
&lt;br /&gt;
* To add 2FA, use TOTP.  Recommended module is Trog::TOTP, it avoids edge cases present in all other options and performs better.&lt;br /&gt;
* To add URL shortening without using external services (useful for things like Emails), use URI::Shortener.&lt;/div&gt;</summary>
		<author><name>GeorgeBaugh</name></author>
	</entry>
</feed>