JIM HUNTER Computer Software & Web Application Development

Some practical Perl applications:

I have found Perl to be very useful in a number of different applications, such as CGI, automation, etc. But one unique application I created uses a combination of Perl and PerlScript. PerlScript is an ActiveX scripting language which runs in Internet Explorer, as well as any other Active Scripting host. I call this application FrameIt. It is actually a bundling of two Perl programs that I developed to aid in my own Web development projects. This application generates an HTML page to view multiple files - image files and HTML files. It's been quite useful. You can check it out [here].

I also created a Web Service demo, in Perl, using the SOAP::Lite module, available from CPAN.org. My Web Service demo provides access to operations of another application I created, the Message Editor application. I have used this application to demo other technologies, such as XSLT and AJAX.

Another Perl script I developed comes in handy during Java development when you need to locate a particular jar file, but don't know which one. This script, findJars.pl , will execute a recursive search to locate java jar files that contain a specified class file. So, for example, when you get a NoClassDefFoundError, or ClassNotFoundException, you can use it to locate the right jar to be included in your classpath. The syntax is similar to the standard Unix find command.

Usage: perl findJars.pl <start> <pattern> [-exec="<command>"]

  <start>:  The directory where the search begins.
<pattern>:  The name of the Java class, or pattern, to locate. Use of the '*'
            meta-character is allowed, e.g., Parser*, *Binding*, etc.
    -exec:  An optional command can be executed on each Jar file which 
            contains the specified class. The optional command must be in 
            quotes (e.g., -exec="copy {} /common/lib"). Note that the '{}' 
            symbol is replaced with the name of a matched
            Jar file.
    -help:  To view this display.
I keep findJars.pl on my path, so whenever I need to locate a jar, I can do something like this:
C:\Projects>findJars C:/Projects/common/lib OracleDriver
And the output is something like this:
Search for Jars containing OracleDriver.class starting at C:/projects/lib:

C:/Projects/common/lib/oracle.jar:
        oracle/jdbc/driver/OracleDriver.class
        oracle/jdbc/OracleDriver.class

C:/Projects/common/lib/classes12.jar:
        oracle/jdbc/driver/OracleDriver.class
        oracle/jdbc/OracleDriver.class

Results: found 2 Jar(s)
copyright © 2003 - 2014 James P Hunter