The following script is meant to write a file based on form input. The script works on the command line but not via CGI. I believe taint checking is to blame. As far a the security aspect this will only be used by me and be password protected so what is written is not a security concern.
#!/usr/bin/perl -w
use strict;
use CGI qw( param header);
$q = new CGI;
my $tela = $q->param('tela');
my $yoken = $q->param('yoken');
if ($tela eq undef) {
print header;
print <<SEIFORM;
<HTML>
<TITLE>seisei</TITLE>
<body bgcolor="black" background="line.gif" alink="#ff9900" link="#ff9
+900"
vlink="#ff9900" text="#ff9900">
<form action="seisei.cgi" method="get" name="seisei">
Tela:<input type="text" value="wiki" name="tela" align="top"
maxlength="25" size="77"><br>
<textarea name=yoken cols=70 rows=12>void</textarea>
<BR>
<input type="submit" value="kuppuku" align="middle">
</BODY>
</HTML>
SEIFORM
} else {
print header;
print <<SUCCESS;
<HTML>
<TITLE>daiseikou</TITLE>
<body bgcolor="black" background="line.gif" alink="#ff9900" link="#ff9
+900" vlink="#ff9900"
+ text="#ff9900">
<CENTER><H1>daiseikou</H1></CENTER>
</BODY>
</HTML>
SUCCESS
open(TELA, ">$tela.tela");
print TELA "$yoken";
print "$yoken";
}
Edit ar0n -- fixed