Perl is a well-known and widely used scripting language for developers and administrators alike. The Win32 port for Perl is stable and has been extended to do just about everything a system administrator would need to do. It's mature, it's easy to use, and it's free. You can't beat that. If you want to learn how to get started in Perl on Win32 platforms, here's how:
None of the Windows OS platforms ship with Perl. Until WScript, there really wasn't a scripting environment for the Win32 base like there is with the *nix systems. A version of Perl was included in the Windows NT 4.0 Resource Kit and a newer version is included in the Windows 2000 Server Resource Kit (RK). However, looking at my documentation for the RK, the version shipped with it is build 521. The current version available for download is 5.6.1 Build 633. Your best bet is to download the latest version. You can find the latest binaries on the ActiveState web site at:
You'll be looking for ActivePerl. Make sure to get the MSI version.
The MSI version is much like any other MSI package. The screens are pretty much self-explanatory, but here's the step-by-step. I've created thumbnails of the screens, so the initial page load won't be extremely slow. Click on the thumbnail and a full-sized view will open in a new window.
We only have one option, but the Welcome screen tells us the version and build of the ActivePerl version we are about to install.
Again, there aren't any options if we want to use ActivePerl. As with any license agreement, read it carefully and make sure it's agreeable to you and your organization. Don't make the mistake found in this User Friendly cartoon.
If you're an experience ActivePerl aficionado, you can alter the features but if you're new, it's best to leave them as they are. One thing you might change is the base install location.
Unless you've purchased ASPN Perl, leave the checkbox unchecked. ASPN Perl is ActiveState's Perl programming bundle. The cost isn't very high, but ASPN Perl isn't necessary to use ActivePerl. If you are interested in finding out more about ASPN Perl, visit the ASPN Perl page.
The setup can perform certain configuration settings for us. The first option is adding Perl to the path. Regardless of what directory you are in, you'll be able to call perl and the OS will know where to find it. The second option allows us to run our Perl scripts without using perl. For instance, if we wanted to run the script HelloWorld.pl, we could enter HelloWorld.pl at the command line instead of perl HelloWorld.pl.
The last two options are only applicable if you have IIS installed on the system. The first of these two, Create IIS script mapping for Perl, is for running Perl as a CGI application. The second option is for running Perl through ISAPI. CGI programs require a separate process for each one concurrently running. IIS is optimized more for the use of .DLLs, which don't run in their own separate process spaces. ISAPI for Perl uses DLL function calls instead of CGI.
Once we've selected what pieces of ActivePerl to install, where to install it, and what configuration settings we want the setup package to modify, we're prompted with one last chance to go back.
This screen shows the status of the install.
The ActivePerl install is complete. If you want to view the release notes, check the box before clicking finish.
The default ActivePerl install has several useful packages which are specifically for Win32 administration. Some of the more commonly used ones are:
Win32::Event
Win32::EventLog
Win32::File
Win32::FileSecurity
Win32::NetAdmin
Win32::NetResource
David Roth has produced some additional packages which contain functionality not present in the packages contained with the default install. Some of the more commonly used ones are:
Win32::AdminMisc
Win32::Daemon
Win32::Message
Win32::Perms
These packages and more are available at http://www.roth.net/perl/ for download or install using PPM (see the ActivePerl documentation for more on how to use this tool).
Learning Perl on Win32 SystemsThe "gecko" book is a good primer if you aren't familiar with Perl. It follows closely with the Learning Perl book which is geared more towards Unix. The Win32 edition removes some of the material from the original which doesn't apply to the Win32 architecture while adding in appropriate content for Windows-based systems.
|
|
![]() |
Win32 Perl Programming: The Standard ExtensionsDavid Roth's book on programming Perl in the Win32 environment. The book expects a basic level of knowledge of Perl such as what would be gained by working through the gecko book. It is probably THE book on using Perl for administrative functions such as maintaining users and groups, reading event logs, and managing file permissions.
|
![]() |
Perl for System AdministrationThis is a cross-platform book covering Unix, Win32, and Mac. There's quite a bit of material in it, and if you're new to Perl and want to learn how to use it for system administration, take a look at this book.
|
![]() |
Perl CookbookThis is a great tome for finding examples of how to do things in Perl. It is built around Problem - Solution - Discussion to present Perl in a practical way. The purpose of this book was to provide additional material which couldn't be placed in the encyclopedic (but still readable) Programming Perl.
|
![]() |
Programming PerlThe "camel" book is the classic. This is a must have for any serious practitioner of Perl. Now in its 3rd edition, this book is packed full of information and programming examples on Perl. This book goes in far more detail than Learning Perl.
|
![]() |
Perl in a NutshellA good all-purpose reference manal. Like most of the Nushell series, it provides the core information without a lot of fluff.
|
![]() |
The Perl CD BookshelfThis is really a GREAT deal. Not only do you get a paperback copy of Perl in a Nutshell, but you also get Learning Perl, Programming Perl, the Perl Cookbook, Perl & XML, Perl & LWP, and Mastering Perl/Tk on CD (Perl in a Nutshell is included on the CD as well). All in a web document format. The books that make up this package are significantly greater than the cost for the CD Bookshelf. |
Basically, the comp.perl.* newsgroups are all good sources to discuss and learn about Perl. Point to your NNTP server and chances are you'll find the comp.perl.* groups available. In addition, there are a couple of other NNTP servers which host newsgroups on Perl:
Practice makes perfect. Like any programming language, the best way to become familiar with it is to start coding in it. If you want to start with the classic "Hello, World!" example, here it is:
print "Hello, World!\n";
That's it! I'll leave the rest to you.
Last Updated: 12/06/2002 23:45 -0500