PerlScript




What is PerlScript?

PerlScript is an ActiveX scripting engine that allows you to use Perl with any ActiveX scripting host. At this time, ActiveX scripting hosts include:


What do I need to run PerlScript?


How do I install PerlScript?

When you launch the ActivePerl installer, PerlScript is one of the components you can optionally install. You must install, or have previously installed, ActivePerl to use PerlScript.


How can I configure PerlScript security?

PerlScript in IE 4.0 and higher can be enabled/disabled by zones

Values

IE3 is more limited; it is an all or nothing affair. For IE3 the only values recognized are

Values


Why aren't my event handlers called?

Case sensitive lookup of event names may be being performed. Event name lookup can be made case insensitive by adding key


What is Windows Scripting Host?

Microsoft advertises Windows Scripting Host, 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.

More information on Windows Scripting Host can be found on the Microsoft Web Site at: http://www.microsoft.com/scripting/.


Can I write Active Server Pages with PerlScript?

Active Server Pages, or ASP for short, generate HTML on your Web server and send it to the browser. ActivePerl and PerlScript are required on your server but they are not required on the clients.

To identify server-side Perl code to the server, you must do one of the following:

  use the <SCRIPT> tag

or

  wrap your code in <% and %>

The example below uses the <SCRIPT> tag.

 

To do the same by wraping your code in <% and %>: The first line of the script, <%@ LANGUAGE = PerlScript %> tells the server that you are using PerlScript, rather than any of the other scripting languages supported by Active Server Pages.

Another option is enclosing anything that you want to be displayed as HTML as follows:

 

This will display the value of the variable $hello.


Client-side PerlScript

Client-Side PerlScript has Perl embedded within your HTML documents. All PerlScript code must be contained within <SCRIPT LANGUAGE="PerlScript"> </SCRIPT>

Client-side PerlScript has the added requirement that both ActivePerl and PerlScript be installed on each computer will will be loading PerlScript pages.

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.

To display something to the browser, use the write() method of the document object. You can use the write() method with $windows->document->write('any old text').

The sample below is another Hello World variation, but this time using client-side PerlScript:


Other References

Here's a short list of PerlScript FAQs available on the net:  

 

 PerlScript