<P>Microsoft advertises <B>Windows Scripting Host</B>, or WSH for short, as being "a
language-independent scripting host for 32-bit Windows operating system platforms". WSH offers
a lot to VBScript and JScript developers for whom console type programs have been traditionally
difficult. For Perl Developers, however, the same functionality can be found with a Perl module or
extension.
<P>More information on Windows Scripting Host can be found on the Microsoft Web Site at: </A><A href="http://www.microsoft.com/scripting/">http://www.microsoft.com/scripting/</A>.
<P><A name="active_server_pages">
<HR>
<H1>Can I write Active Server Pages with PerlScript?</H1>
<P><B>Active Server Pages</B>, or ASP for short, generate HTML on your Web server and send it to the
browser. <B>ActivePerl</B> and <B>PerlScript</B> are required on your server but they are not
required on the clients.
<P>To identify server-side Perl code to the server, you must do one of the following:
<P> use the <CODE><SCRIPT></CODE> tag
<P>or
<P> wrap your code in <CODE><%</CODE> and <CODE>%></CODE>
<P>The example below uses the <CODE><SCRIPT></CODE> tag.
<P>
<UL>
<CODE><%@ LANGUAGE = PerlScript %><BR>
<HTML><BR>
<HEAD><BR>
<TITLE>PerlScript Hello World!</TITLE><BR>
</HEAD><BR>
<BODY BGCOLOR="#FFFFFF"><BR>
<H1>PerlScript Hello world!</H1><BR>
<P><BR>
<SCRIPT LANGUAGE="PerlScript" RUNAT=Server><BR>
$Response->write("Hello world!");<BR>
</SCRIPT><BR>
</BODY><BR>
</HTML><BR>
</CODE>
</UL>
To do the same by wraping your code in <CODE><%</CODE> and <CODE>%></CODE>:
<UL>
<CODE><%@ LANGUAGE = PerlScript %><BR>
<HTML><BR>
<HEAD><BR>
<TITLE>PerlScript Hello World!</TITLE><BR>
</HEAD><BR>
<BODY BGCOLOR="#FFFFFF"><BR>
<H1>PerlScript Hello world!</H1><BR>
<%<BR>
$Response->write("Hello world!");<BR>
%><BR>
</BODY><BR>
</HTML><BR>
</CODE>
</UL>
The first line of the script, <CODE><%@ LANGUAGE = PerlScript %></CODE> tells the server that
you are using PerlScript, rather than any of the other scripting languages supported by Active
Server Pages.
<P>Another option is enclosing anything that you want to be displayed as HTML as follows:
<P>
<UL>
<CODE><%= $hello %></CODE>
</UL>
<P>This will display the value of the variable <CODE>$hello</CODE>.
<P></A><A name="client_side">
<HR>
<H1>Client-side PerlScript</H1>
<P>Client-Side PerlScript has Perl embedded within your HTML documents. All PerlScript code must be
contained within <CODE><SCRIPT LANGUAGE="PerlScript"> </SCRIPT></CODE>
<P>Client-side PerlScript has the added requirement that both ActivePerl and PerlScript be installed
on each computer will will be loading PerlScript pages.
<P>Client-side Perlscript should only be used if you can control the ocnfiguration of the computers
on which it will be run. If your goal is build an application which will be used by a large number
users, Server-side PerlScript is considerably more practical.
<P>To display something to the browser, use the <CODE>write()</CODE> method of the document object.
You can use the <CODE>write()</CODE> method with <CODE>$windows->document->write('any old
text')</CODE>.
<P>The sample below is another Hello World variation, but this time using client-side PerlScript:
<UL>
<CODE><HTML><BR>
<HEAD><BR>
<TITLE>PerlScript Hello World!</TITLE><BR>
</HEAD><BR>
<BODY BGCOLOR="#FFFFFF"><BR>
<H1>PerlScript Hello world!</H1><BR>
<SCRIPT LANGUAGE="PerlScript"><BR>
$window->document->write('Hello world!');<BR>
</SCRIPT><BR>
</BODY><BR>
</HTML><BR>
</CODE>
</UL>
<P></A><A name="other_references">
<HR>
<H1>Other References</H1>
<P>Here's a short list of PerlScript FAQs available on the net: </A>