I want to create single-user applications to be run on a single PC that you download. The installer would include ActivePerl, should it be necessary. I can't use JavaScript because I want to use
DBD::SQLite, plus I don't want to learn a whole new language.
Put it this way - the simple utility apps I want to create and distribute would take between 2-4 days each ... assuming I can use Perl for DBD::SQLite and HTML::Template. The engines for these utilities are very small and easy ... Heck, I've already written most of the engines for two of the utilities in the general course of my work. I don't want to reimplement them, if at all possible, or spend a month learning Tk. But, I don't want to require using a webserver, even one as small as webmin.
As for not needing much to document ... Converting from JScript to PScript is almost impossible for non-trivial cases. Take the following rather simplistic example in JavaScript:
<html>
<head>
<title>Test</title>
<script language="JavaScript">
var button1 =
'<input type="button"' +
' name="click1"' +
' value="Button1"' +
' onclick="parent.click1()"' +
'>';
var button2 =
'<input type="button"' +
' name="click2"' +
' value="Button2"' +
' onclick="parent.click2()"' +
'>';
function update ()
{
window.contentFrame.document.open("text/html");
window.contentFrame.document.write( button1 );
window.contentFrame.document.close();
}
function click1 ()
{
window.contentFrame.document.open("text/html");
window.contentFrame.document.write( button2 );
window.contentFrame.document.close();
}
function click2 ()
{
window.contentFrame.document.open("text/html");
window.contentFrame.document.write( button1 );
window.contentFrame.document.close();
}
</script>
</head>
<frameset onLoad="update()">
<frame src="about:blank" name="contentFrame" noresize>
</frameset>
</html>
Here's the direct translation (as I understand it) to PerlScript.
<html>
<head>
<title>Test2</title>
<script language="PerlScript">
$button1 = q{
<input type="button"
name="click1"
value="Button1"
onclick="$parent->click1()"
language="PerlScript"
>
};
$button2 = q{
<input type="button"
name="click2"
value="Button2"
onclick="$parent->click2()"
language="PerlScript"
>
};
sub update()
{
$window->contentFrame->document->open("text/html");
$window->contentFrame->document->write( $button1 );
$window->contentFrame->document->close();
}
sub click1 ()
{
$window->contentFrame->document->open("text/html");
$window->contentFrame->document->write( $button2 );
$window->contentFrame->document->close();
}
sub click2 ()
{
$window->contentFrame->document->open("text/html");
$window->contentFrame->document->write( $button1 );
$window->contentFrame->document->close();
}
</script>
</head>
<body name="parentFrame" onLoad="update()" language="PerlScript">
<frame src="about:blank" name="contentFrame" noresize>
</body>
</html>
The JavaScript version works as expected, but the PerlScript one doesn't even run the onLoad handler. What's the difference? What am I missing?
I'm on WinXP Pro, IE 6.0.2x, the latest build of ActivePerl (downloaded within the past week).
Update: Changed to match Erto's statement. It still doesn't work.
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.