Databases Reference
In-Depth Information
If you're sure that you have Apache but not PHP, or that your PHP installation does
not support MySQL, the easiest solution is to reinstall by following the instructions
earlier in this chapter.
Setting up Perl
Chapters 16, 17, and 18 require that you have a working installation of Perl. Perl is
available as standard on almost all Linux and Mac OS X systems, and it is included in
the XAMPP integrated package, so you don't need to install it separately. For Chapters
17 and 18, you'll need two Perl extension packages or modules . We'll use the Perl DBI
(Database Interface) module in Chapter 17 to talk to a MySQL server, and the Perl CGI
(Common Gateway Interface) module in Chapter 18 to write clean and readable scripts
that can be run by a web server. If you're not planning to write complex Perl scripts for
a web application, you can manage without the CGI module, but you'll definitely need
the DBI module to use Perl for interaction with MySQL.
Checking Your Existing Setup
To run Perl scripts, you need to know where the Perl interpreter (called perl ) is installed
on your system. For Linux, we'll use the instance of Perl that comes with the distribu-
tion; to find where this is located, use the which command:
$ which perl
/usr/bin/perl
In this example, the Perl interpreter is the file /usr/bin/perl .
For Windows and Mac OS X systems, we'll use the instance of Perl that comes with
XAMPP. On a Windows system, the XAMPP Perl interpreter is C:\Program Files
\xampp\perl\bin\perl.exe , while on a Mac OS X system, the XAMPP Perl interpreter
is /Applications/xampp/xamppfiles/bin/perl . You can also use the Mac OS X system de-
fault installation ( /usr/bin/perl ), but as we discuss later in “Installing Perl modules under
Mac OS X,” we recommend you stick with the XAMPP installation for consistency.
Let's start by examining what the version of this Perl installation is. On a Linux system,
type:
$ perl --version
On a Windows or Mac OS X system, the XAMPP Perl interpreter is not in the system
path, so you should specify the full path on a Windows system as:
C:\> C:\Program Files\xampp\perl\bin\perl --version
or on a Mac system as:
$ /Applications/xampp/xamppfiles/bin/perl --version
 
Search WWH ::




Custom Search