<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pickwiki.org/index.php?action=history&amp;feed=atom&amp;title=Rs-Form.Pl</id>
	<title>Rs-Form.Pl - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pickwiki.org/index.php?action=history&amp;feed=atom&amp;title=Rs-Form.Pl"/>
	<link rel="alternate" type="text/html" href="https://pickwiki.org/index.php?title=Rs-Form.Pl&amp;action=history"/>
	<updated>2026-04-28T23:42:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://pickwiki.org/index.php?title=Rs-Form.Pl&amp;diff=2196&amp;oldid=prev</id>
		<title>Conversion script: link fix</title>
		<link rel="alternate" type="text/html" href="https://pickwiki.org/index.php?title=Rs-Form.Pl&amp;diff=2196&amp;oldid=prev"/>
		<updated>2015-02-26T23:48:55Z</updated>

		<summary type="html">&lt;p&gt;link fix&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;HomePage&amp;gt;&amp;gt;SourceCode&amp;gt;&amp;gt;[[PerlSource]]&lt;br /&gt;
&lt;br /&gt;
This script is referenced from a web page form, marshalls all the parameters and passes them thru a named pipe to CGI.MASTER.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sunset /usr/local/apache/share/cgi-bin&amp;gt; cat rs-form.cgi &lt;br /&gt;
#!/usr/local/bin/perl&lt;br /&gt;
use CGI qw(:standard);&lt;br /&gt;
&lt;br /&gt;
print header();&lt;br /&gt;
&lt;br /&gt;
$acc=param(&amp;quot;account&amp;quot;);&lt;br /&gt;
if ($acc eq &amp;quot;&amp;quot;) {&lt;br /&gt;
   print &amp;quot;&amp;lt;H1&amp;gt;Internal cgi error - must specify an account!&amp;lt;/H1&amp;gt;\n&amp;quot;;&lt;br /&gt;
   exit 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Use process id for temp file&lt;br /&gt;
$rr = $$;&lt;br /&gt;
# This is the named pipe that the basic program is monitoring&lt;br /&gt;
$infile = &amp;quot;/samba_share/web/in/$acc/in_from_perl&amp;quot;;&lt;br /&gt;
open(INFO, &amp;quot;&amp;gt;$infile&amp;quot;) or die &amp;quot;Cannot open $infile&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# Make the named pipe to read from, later&lt;br /&gt;
$outfile = &amp;quot;/samba_share/web/out/$acc/$rr&amp;quot;;&lt;br /&gt;
if (system(&amp;#039;mknod&amp;#039;, $outfile, &amp;#039;p&amp;#039;)) {&lt;br /&gt;
   die &amp;quot;mknod $outfile failed&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
chmod 0777, $outfile;&lt;br /&gt;
&lt;br /&gt;
# Delimiter to seperate rows is @AM&lt;br /&gt;
$rec_delim=chr(254);&lt;br /&gt;
# Delimiter to seperate fields is @VM&lt;br /&gt;
$fld_delim=chr(253);&lt;br /&gt;
&lt;br /&gt;
# First, tell CGI.MASTER the place to write its output - the named pipe&lt;br /&gt;
# we just created.  as soon as we send everything, we&amp;#039;ll wait for some&lt;br /&gt;
# output from the named pipe&lt;br /&gt;
print INFO $outfile,$rec_delim;&lt;br /&gt;
&lt;br /&gt;
foreach $key (param()) {&lt;br /&gt;
   # This join is a little obscure - if the field being returned is&lt;br /&gt;
   # single valued it does nothing.  only for select lists with multiple&lt;br /&gt;
   # items does it produce a dynamic array&lt;br /&gt;
   $value = join($fld_delim, param($key));&lt;br /&gt;
   &lt;br /&gt;
   # Likewise, this next line usually does nothing, except when a multi-line&lt;br /&gt;
   # text box is being retrieved.  it too produces a dynamic array&lt;br /&gt;
   $value =~ s/\r\n/$fld_delim/og;&lt;br /&gt;
   &lt;br /&gt;
   # Send the data thru the named pipe to CGI.MASTER&lt;br /&gt;
   print INFO &amp;quot;$key=&amp;quot;,$value,$rec_delim;&lt;br /&gt;
}&lt;br /&gt;
# Send the IP address of the remote host&lt;br /&gt;
print INFO &amp;quot;ip=&amp;quot;,$ENV{[[REMOTE_ADDR]]},$rec_delim;&lt;br /&gt;
&lt;br /&gt;
close(INFO) or die &amp;quot;Cannot close $infile&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# This next line will block until something is sent to the named pipe&lt;br /&gt;
open(OUTF, &amp;quot;&amp;lt;$outfile&amp;quot;) or die &amp;quot;Cannot open $outfile&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# Ok, now we&amp;#039;ve got some data, send it to stdout, which the web server&lt;br /&gt;
# will pass on to the browser... oh, the tangled webs we weave!&lt;br /&gt;
while (&amp;lt;OUTF&amp;gt;) {&lt;br /&gt;
   # We undo the messing around with field delims on the way back&lt;br /&gt;
   s/$rec_delim/\n/og;&lt;br /&gt;
   s/$fld_delim/\n/og;&lt;br /&gt;
   print;&lt;br /&gt;
}&lt;br /&gt;
print end_html;&lt;br /&gt;
&lt;br /&gt;
# Finally, get rid of the temporary named pipe&lt;br /&gt;
unlink($outfile);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Conversion script</name></author>
	</entry>
</feed>