Perl has been a popular language for Unix administrators for years. It is flexible, easy to learn, and capable of doing some very powerful things with relatively few lines of code. Perl has been ported to the Windows environment and is currently supported on Windows by the ActiveState Tool Corporation. ActiveState released its first beta version onDecember 4, 1996. Since that time, companies like O'Reilly and Associates and Microsoft have partnered with ActiveState. As of the writing of this article, ActivePerl 184.108.40.2063 is the current production version. However, ActivePerl 5.8.0 Beta 1 is also available for download. Since this is the first of a series on using Perl to connect to SQL Server, I'll talk a bit about Perl here that I'll forego inthe later articles.
Why Use Perl
Perl has a broad base of support that spans operating systems, users, communities, cultures. It's a very simple language to learn, but as with any robust language, one will never feel like one has complete mastery over all the intricacies of it. The port for Windows is very similar to the ones for other operating systems, meaning a lot of code re-use, a lot ofcross-platform capability, a lot of others who can be solicited for aid, regardless of what they happen to be running on. Also, Perl is fast. It's efficient. And development efforts in Perl don't generally take a long time. Combine this with the power of Perl, and it is a great choice as a development language.
Is Perl necessarily better than other languages? The answer is, of course, that itdepends. There are some things that Perl does better than typical development languages like VBScript and JScript. One of these things is handling regular expressions. Perl is a monster language when it comes to dealing with strings and string processing. Because Perl is so strong in this suit, it is the most popular web programming language. Major companies like Amazon.com use Perl to run their websites. However, it's not better in "all cases." No language is.
Why I Use Perl
When I first started looking at Perl, I will admit I was amazed with its flexibility and its simplicity. I was able to write quick scripts in a very short period of time. When I compared my development time on Perl with what I knew it would take in other languages, I was sold. Perl has become more and more adaily tool for me as my work responsibilities have expanded from being a DBA to overseeing the architecture and health of our enterprise. Monitoring event logs, server processes, etc. can all be done with scripts in very little time. For instance, when we started having problems with our external mail server refusing connections, a quick 10-minute script let me check its status every 5 minutes and ifI detected a refused connection, I shot an email message to one of our internal servers notifying the appropriate personnel. I don't even want to think about how long it would have taken in another language.
With that being said, let me say one of the reason a lot of my development times have been reduced are because of those who have written the packages I've used in the process of my efforts.I monitor event logs. I check the status of services. I determine changes in the users and groups within the domain. I attempt to open an SMTP connection to the external mail server... all through packages that have been written, tested, and heavily used by others. The broad base of support and the activity of those using this language are two things I really love. There are numerous news groupsand mailing lists for this language. There are very active ones devoted to Windows alone. If you have a question about Perl, getting an answer is easy and quick. Chances are someone on one of the forums or mailing lists has done what you are attempting to do (actually it seems more like 50 people most of the time).
Where I Won't Use Perl
I won't use Perl (unless the functionality I need...