<body id="Bel">
<div id="Response"></div>
<h2>Test of PerlScript</h2>
<p>
<textarea id="htmlstr" rows="15" cols="25"></textarea>
<br><input type="button" onclick="wrhta" value="Write to html file">
<br><input type="button" onclick="apphta" value="append to html file">
</p>
<script language="PerlScript">
sub sayHello {
# This function takes two parameters, creates a string
# from the parameters, and returns the string.
# get the two parameters into local variables
my ($strName, $strTime) = @_;
#now, create the return string.
$strRetVal="Hello $strName. The time is $strTime.";
# Return the string
$strRetVal;
}
use FileHandle;
sub wrhta {
$fh = new FileHandle ">> Begin.htm";
if (defined $fh) {
my $HTMLstr = $window->document->getElementById("htmlstr"
->innerText;
print($fh "$HTMLstr\n"
;
$fh->close;
}
}
sub apphta {
$fh = new FileHandle "Begin.htm", O_WRONLY|O_APPEND;
if (defined $fh) {
my $HTMLstr = $window->document->getElementById("htmlstr"
->innerText;
print($fh "$HTMLstr\n"
;
undef $fh; # automatically closes the file
}
}
</script>
</body>
this is an interpolation of my web page own ability to write html to it self but this writes your html to another file, if you cant tell.
<div id="Response"></div>
<h2>Test of PerlScript</h2>
<p>
<textarea id="htmlstr" rows="15" cols="25"></textarea>
<br><input type="button" onclick="wrhta" value="Write to html file">
<br><input type="button" onclick="apphta" value="append to html file">
</p>
<script language="PerlScript">
sub sayHello {
# This function takes two parameters, creates a string
# from the parameters, and returns the string.
# get the two parameters into local variables
my ($strName, $strTime) = @_;
#now, create the return string.
$strRetVal="Hello $strName. The time is $strTime.";
# Return the string
$strRetVal;
}
use FileHandle;
sub wrhta {
$fh = new FileHandle ">> Begin.htm";
if (defined $fh) {
my $HTMLstr = $window->document->getElementById("htmlstr"
print($fh "$HTMLstr\n"
$fh->close;
}
}
sub apphta {
$fh = new FileHandle "Begin.htm", O_WRONLY|O_APPEND;
if (defined $fh) {
my $HTMLstr = $window->document->getElementById("htmlstr"
print($fh "$HTMLstr\n"
undef $fh; # automatically closes the file
}
}
</script>
</body>
this is an interpolation of my web page own ability to write html to it self but this writes your html to another file, if you cant tell.