Get Perl
Perl is a powerful tool for processing data. Here is how to get a free version for your PC.
Many hacks in this book require tedious, repetitive, and boring work: fetching files from the Internet, running programs to transform them, and saving them to databases. I hate doing tedious work, so I get my computer to do it for me. I usually use Perl for tasks like these, and I have chosen to use Perl in many of the hacks provided in this book.
Perl is a very powerful scripting tool that we’ll use to download files from the Internet, parse files to extract information, and write output to a database. (You can use it for many other things, but we won’t.)
If you want to run Perl scripts, this hack explains how to do that. If you’re interested in understanding how my scripts work and want to modify them to do other things, see “Learn Perl” [Hack #13] for more information about the Perl language.
Getting and Installing Perl
If you’re using Linux or the Mac OS, you probably already have Perl installed on your computer. (Just make sure you install all the modules we’ll need, which I’ll describe shortly.) But if you use Windows, you’ll need to install Perl yourself. Since Perl is essential to running many of the hacks in this book, here is how to get it and install it.
Installing Perl on Windows is fairly straightforward, and you can do it with a minimum of fuss using ActiveState’s ActivePerl, a free version of Perl for Windows. The first step is to download the installation files from ...
Get Baseball Hacks now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.