![]() After validating this fact and a few other related pieces of information, it automatically downloads the latest existing tarball from the mirror and installs it for you. This sets off a train of events in which CPAN goes off to the nearest mirrors, First, it interrogates the Comprehensive Perl Archive Network, as to whether our target module really exists. We then install Number::Format with a straightforward instruction at the cpan> prompt. We enter the shell via the following command: $ perl -MCPAN -e "shell" cpan shell CPAN exploration and modules installation (v1.59_51) ReadLine support enabled cpan> Once you've completed these, you're ready to start installing online!įirst, we'll try the interactive CPAN shell, and install Number::Format, a helpful Perl module for manipulating number and string displays, particularly financial data: When you run its shell (described in the next section) for the first time, it will ask you a one-time series of short configuration questions. The CPAN module comes prebundled with Perl. We'll load up two modules in the following sections using these methods. You can use either an interactive shell or a direct command-line instruction. If you have a valid Internet connection open, you will have two ways of using CPAN. ![]() The perldoc (Perl documentation) program itself is installed automatically with Perl, as part of the general Perl development environment. You can learn the details of this built-in module by running the following commands: The CPAN module (a separate entity from CPAN itself) provides a streamlined way to install Perl modules. However, there is a way to cut down on this effort, and that's to use the CPAN module described in the next section. $ gzip SomeModule-1.00.tar.gz # Unzip archive $ tar xvf SomeModule-1.00.tar # Unpack archive $ cd SomeModule-1.00 # Enter archive $ perl Makefile.PL # Configure the build $ make # Build, or compile, the module $ make test # Test the module's compilation $ make install # Install the tested module This process often requires specifying the following steps on the command line (once the module tarball has been downloaded from the CPAN site, ). 2.2.1.1 The traditional methodīriefly, the traditional method consists of the following steps:ĭownload a module's tarball from. We recommend the traditional method, as we describe in the next section, but because the CPAN method is quite popular, we'll describe that one here as well. The first is what some people call the traditional method. There are two basic approaches to installing Perl modules (for example, Perl DBI, DBD::Oracle, and the many other modules we'll be discussing in later chapters) on Unix systems. 2.2.1 Methods for Installing Perl Modules The Perl DBI architectureīefore we get to the DBI and DBD::Oracle modules, however, we need to take a step back to discuss the methodology we'll be using for installing Perl modules onto Unix systems, both here and in the rest of the book. ![]() We'll show how to install the DBI modules for both Unix and Win32. For more information about Perl DBI's capabilities, see Appendix B, and the book and online references listed in Chapter 1. This section focuses on the installation of Perl DBI. Doing so can be especially useful when you want to transfer information from one database type to another without having to use Oracle's SQL*Loader product. ![]() You can even access different database types within the same Perl script using DBI. This figure also demonstrates how the same Perl DBI interface can be used, with other drivers, to connect to other databases, and how all of these drivers are hidden from your Perl scripts by the DBI package. The architecture for this arrangement, which takes full advantage of the object-oriented features available within Perl 5, is shown in Figure 2-2. These modules let us gain access to our target database through the Oracle Call Interface provided by Oracle Corporation. The best way to do this is via the magic of the Perl DBI module and its Oracle-specific database driver, DBD::Oracle. Now that you've installed Perl itself, you need to set things up so your Perl programs can communicate with your Oracle database.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |