Subscribe to Windows IT Pro
August 11, 2006 12:00 AM

How to Get Started Writing Scripts

Resources recommended by scripting experts
Windows IT Pro
InstantDoc ID #92751
Rating: (1)

Perl
Perl is one of the harder scripting languages to learn. However, it offers some benefits, such as being able to run your scripts on platforms such as Linux and Macintosh as well as on Windows. Roth Consulting's "PERL: The Practical Extraction & Reporting Language" Web page (http://www.roth.net/perl) discusses some other benefits of using Perl. This Web page also has a link to the ActiveState Web site, which offers a free, ready-to-install distribution of Perl called ActivePerl. One of the most popular Perl distributions, ActivePerl includes not only the core Perl engine but also some popular Perl modules and the Perl Package Manager (PPM) for installing Comprehensive Perl Archive Network (CPAN) modules.

If you're a Perl newbie, you might be wondering what modules are. Perl modules are reusable software components that offer specific functionality. For example, the Win32::Perms module lets you modify permissions on files, directories, registry keys, network shares, and shared printers. The only way you can take advantage of a Perl module's functionality is through a Perl script—you can't run modules by themselves. The CPAN Web site (http://www.cpan.org) offers a large collection of Perl modules. The PPM for CPAN lets you install a Perl module from that Web site by typing a simple command.

After you've installed a Perl distribution, you're ready to learn Perl. The book to start with depends on your background:

  • If you aren't familiar with programming concepts and would like to use Perl on cross platforms, check out Learning Perl, 4th ed. (O'Reilly, 2005) by Randal L. Schwartz, Tom Phoenix, and Brian D. Foy.
  • If you're already familiar with programming concepts and want to use Perl on cross platforms, check out Programming Perl, 3rd ed. (O'Reilly, 2000) by Larry Wall, Tom Christiansen, and Jon Orwant. This book is considered the Perl bible.
  • If you aren't familiar with programming concepts and would like to use Perl on the Win32 platform only, check out Learning Perl on Win32 Systems (O'Reilly, 1997) by Randal L. Schwartz, Erik Olson, and Tom Christiansen.

After you have a basic understanding of the Perl language, you can focus on areas of interest to you. For Windows systems administrators, two books of interest are

  • Dave Roth's Win32 Perl Programming: The Standard Extensions, 2nd ed. (New Riders, 2001). This book covers many of the standard Win32-specific modules that come with Perl.
  • Dave Roth's Win32 Perl Scripting: The Administrator's Handbook, 2nd ed. (New Riders, 2000). This book discusses how to use Perl to automate common tasks that Windows administrators face.

DBAs will want to check out Programming the Perl DBI (O'Reilly, 2000) by Alligator Descartes and Tim Bunce. This book covers the Perl Database Interface (DBI), a Perl-specific interface that provides database functionality.

If you run into problems learning Perl, I suggest visiting some of the many newsgroups and forums in which you can talk with Perl enthusiasts. Besides the Windows IT Pro Scripting forum, you can check out the forums and newsgroups listed on the Win32 Perl Links Web page (http://www.roth.net/perl/links).

T-SQL
T-SQL is the built-in scripting language of Microsoft SQL Server. T-SQL underwent some major changes in SQL Server 2005, so if you want to learn this scripting language, it's best to learn the 2005 version. One recently released book that might help you do so is Beginning Transact-SQL With SQL Server 2000 and 2005 (Wrox Press, 2005) by Paul Turley and Dan Wood. None of the scripting experts I talked with are familiar with this book, but it received an average rating of 4 stars on Amazon.com. Another resource is SQL Server 2005 Books Online (BOL). You can download BOL for free at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx.

Because T-SQL is based on SQL, getting an idea of how SQL works can be helpful. To get a background on SQL, you can check out Robert Sheldon's SQL: A Beginner's Guide, 2nd ed. (McGraw-Hill Osborne Media, 2003). Note, though, that this book won't help you learn T-SQL syntax.

If you run into problems learning T-SQL, you can ask questions on the SQL Server Magazine T-SQL forum at http://sqlforums.windowsitpro.com/web/forum/default.aspx?forumid=10. You can also interact directly with TSQL master Itzik Ben-Gan through his blog, Puzzled by T-SQL, at http://www.sqlmag.com. For a list of T-SQL newsgroups and Web sites, go to http://www.insidetsql.com/resources.htm.

Powerscript
Although Windows PowerShell is still a release candidate, you can start learning about this new commandline shell and its scripting language. At least one book has already been published: Andy Oakley's Monad (O'Reilly, 2005). Another book, Windows PowerShell in Action, is tentatively scheduled for publication in November by Manning Publications. Bruce Payette, a member of the Windows PowerShell team, is writing this book. You can read an unedited chapter at http://www.manning.com/payette.

Other types of resources are also available. Microsoft's Channel9 (http://channel9.msdn.com) has some good basic information about PowerShell. The Windows Power Shell Wiki (http://channel9.msdn.com/wiki/default.aspx/Channel9.WindowsPowerShellWiki) includes download information and a link to an FAQ Web page. The Microsoft TechNet Script Center offers the "Scripting with Windows PowerShell" Web site (http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx), which includes links to articles, Webcasts, and scripts.

Other useful resources are newsgroups and blogs. You can find the microsoft.public.windows.powershell newsgroup on news.microsoft.com. If you don't use a standard newsreader, you can use the Web interface at http://support.microsoft.com/newsgroups/newsReader.aspx?dg=microsoft.public.windows.powershell. PowerShell blogs include the Windows PowerShell blog at http://blogs.msdn.com/powershell and the PowerShelled blog at http://mow001.blogspot.com.

A Work in Progress
This list of shell scripting, VBScript, JScript, Perl, T-SQL, and Powerscript resources isn't meant to be all-inclusive. But it does offer resources that are known to be helpful when you're learning these scripting languages. If you've come across any other useful resources, please let me know and I'll add them to the list.

Related Content:

ARTICLE TOOLS

Comments
  • Siddram
    6 years ago
    Nov 10, 2006

    it nice

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.