<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.perl-guilds.net/index.php?action=history&amp;feed=atom&amp;title=Portal%3APerl_CGI_Programming</id>
	<title>Portal:Perl CGI Programming - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.perl-guilds.net/index.php?action=history&amp;feed=atom&amp;title=Portal%3APerl_CGI_Programming"/>
	<link rel="alternate" type="text/html" href="https://wiki.perl-guilds.net/index.php?title=Portal:Perl_CGI_Programming&amp;action=history"/>
	<updated>2026-05-01T10:18:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.perl-guilds.net/index.php?title=Portal:Perl_CGI_Programming&amp;diff=162&amp;oldid=prev</id>
		<title>GeorgeBaugh: deploying psgi</title>
		<link rel="alternate" type="text/html" href="https://wiki.perl-guilds.net/index.php?title=Portal:Perl_CGI_Programming&amp;diff=162&amp;oldid=prev"/>
		<updated>2025-01-24T18:42:57Z</updated>

		<summary type="html">&lt;p&gt;deploying psgi&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:42, 24 January 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l13&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&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;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&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;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* You&amp;#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&amp;#039;ll want to reach for.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* You&amp;#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&amp;#039;ll want to reach for.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&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;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Specific Features:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Specific Features:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&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&amp;oldid=prev</id>
		<title>GeorgeBaugh: Basic information</title>
		<link rel="alternate" type="text/html" href="https://wiki.perl-guilds.net/index.php?title=Portal:Perl_CGI_Programming&amp;diff=159&amp;oldid=prev"/>
		<updated>2025-01-24T18:37:38Z</updated>

		<summary type="html">&lt;p&gt;Basic information&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&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&amp;#039;t do well if you don&amp;#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&amp;#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&amp;#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&amp;#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&amp;#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&amp;#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>