extern: back index
intern: install | windows ppm CPAN unix | end
Update 2007.02.20 - From about ActivePerl version 5.8.8.819, the Perl Package Manager, ppm, is a GUI program. Very simple and quite intuitive to use ... it lists what is installed, and what is available ... it will perform the download and install when an item is selected for updating ... and, for example, a single package installs from a site can still be done. For example to install Win32::API::Prototype, enter the following -
C:> ppm install http://www.roth.net/perl/packages/win32-api-prototype.ppd
Note the package name Win32::API::Prototype has been entered as win32-api-prototype.ppd. Alternatively, in the Perl Package Manager GUI, you can set MENU View -> All Packages Ctrl+1 ON, and search for the package. It appears the above particular package is no longer available (2008-12-10), but for say the package Win32::Console::ANSI - to be able to add ANSI Color escape sequences - can be searched for using say just 'console', or the full name 'win32-console-ansi' ...
In my Dell02 machine, at this time, 2008-12-10, ppm showed over nine thousand packages available, of which I only have about 46 installed! It will also verify packages, and check for upgradable packages ...
The desired package can be selected, and MENU Action -> Install <name> +, will mark the package for installation. When all the desired packages have been so marked, then MENU File -> Run Marked Actions (Ctrl+Enter), will proceed to download and install the packages into your local system.
Under MENU Edit -> Preferences (Ctrl+p), the Areas tab allows the location of the local site to be viewed, changed, and the Repositories tab allows the online site URL to be viewed, changed ... Ctrl+Q will exit the PPM GUI ...
Further information on PPM can be found at :-
http://docs.activestate.com/activeperl/5.10/bin/ppm.html
...
OLD INFORMATION: If you have installed ActivePerl, there is an interactive installation program - ppm ... Running ppm at the command prompt will open up a ppm shell, and typing 'help' will show the commands available. The command 'upgrade' will list the modules installed, and whether they need upgrading. Of course, you MUST have internet access available to do this ... If you know the ActivePerl module you want, like say XML::Twig then the following commands will do this ...
C:> ppm ppm> install XML::Twig
And it will all be done ... Also you can add other repositories, other than ActivePerl, like - be careful of line wrap. Items beginning with # are comments ONLY ...
C:\> ppm ppm> repository add RK http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58 ppm> set save # note this did not function in my machine??? # But the command 'repository' showed RK in the list ppm> install XML::LibXML # This produced a 'search', stating several modules available. # The command for installing the 1st was - ppm> install XML::LibXML 1
This was the install of Win32::Registry::File ...
C:\GTools\perl>ppm PPM - Programmer's Package Manager version 3.1. Copyright (c) 2001 ActiveState Corp. All Rights Reserved. ActiveState is a devision of Sophos. Entering interactive shell. Using Term::ReadLine::Stub as readline library. Type 'help' to get started. ppm> install Win32::Registry::File could not find ParserDetails.ini in C:/Perl/site/lib/XML/SAX ==================== Install 'Tie-IxHash' version 1.21 in ActivePerl 5.8.6.811. ==================== Downloaded 6054 bytes. Extracting 5/5: blib/arch/auto/Tie/IxHash/.exists could not find ParserDetails.ini in C:/Perl/site/lib/XML/SAX Installing C:\Perl\html\site\lib\Tie\IxHash.html Installing C:\Perl\site\lib\Tie\IxHash.pm Successfully installed Tie-IxHash version 1.21 in ActivePerl 5.8.6.811. ==================== Install 'Win32-Registry-File' version 1.10 in ActivePerl 5.8.6.811. ==================== Downloaded 9051 bytes. Extracting 6/6: blib/arch/auto/Win32/Registry/File/.exists Installing C:\Perl\html\site\lib\Win32\Registry\File.html Installing C:\Perl\site\lib\auto\Win32\Registry\File\autosplit.ix Installing C:\Perl\site\lib\Win32\Registry\File.pm Successfully installed Win32-Registry-File version 1.10 in ActivePerl 5.8.6.811. ppm> exit C:\GTools\perl>
There is a similar CPAN shell covered on that page ... but the simple execution is :-
C:\some-path> perl -MCPAN -e shell
This will invoke a cpan shell, and to install a package :-
cpan> install XML::Parser
A '?' at the shell will list the command, and enter a 'q' to quit the shell ...
And you can also search for a module, say in Yahoo!, seeking say 'perl XML XPath'. This will give a link to - http://search.cpan.org/dist/XML-XPath/ - From here, the latest tar.gz file can be downloaded -
17/07/2007 16:55 39,832 XML-XPath-1.13.tar.gz
Unpack that into a folder, in this case XML-XPath-1.13, and in that folder run the command 'perl Makefile.PL' -
C:\DTEMP\XML-XPath-1.13>perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for XML::XPath
Provided you have the correct MSVC, or other compiler setup then you can run the commands -
> nmake [/nologo]
> nmake /nologo test
> nmake /nologo install
C:\DTEMP\XML-XPath-1.13>nmake Microsoft (R) Program Maintenance Utility Version 8.00.50727.762 Copyright (C) Microsoft Corporation. All rights reserved. cp XPath/Literal.pm blib\lib\XML\XPath\Literal.pm cp XPath/Node/PI.pm blib\lib\XML\XPath\Node\PI.pm cp XPath/Number.pm blib\lib\XML\XPath\Number.pm cp XPath/Node/Attribute.pm blib\lib\XML\XPath\Node\Attribute.pm ... etc ... cp XPath.pm blib\lib\XML\XPath.pm cp XPath/Node/Comment.pm blib\lib\XML\XPath\Node\Comment.pm C:\Perl\bin\perl.exe -MExtUtils::Command -e cp examples/xpath blib\script\xpath pl2bat.bat blib\script\xpath
Then the 'test' ... > nmake /nologo test
C:\DTEMP\XML-XPath-1.13>nmake /nologo test C:\Perl\bin\perl.exe -MExtUtils::Command -e cp examples/xpath blib\script\xpath pl2bat.bat blib\script\xpath C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\arch')" t/*.t t/01basic..................ok t/02descendant.............ok t/03star...................ok ... etc ... t/30lang...................ok t/insert...................ok t/rdf......................ok t/remove...................ok t/stress...................ok All tests successful. Files=35, Tests=187, 7 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00 CPU)
And finally, the install - > nmake /nologo install
C:\DTEMP\XML-XPath-1.13>nmake /nologo install C:\Perl\bin\perl.exe -MExtUtils::Command -e cp examples/xpath blib\script\xpath pl2bat.bat blib\script\xpath Installing C:\Perl\html\site\lib\XML\XPath.html Installing C:\Perl\html\site\lib\XML\XPath\Boolean.html Installing C:\Perl\html\site\lib\XML\XPath\Builder.html ... etc ... Installing C:\Perl\site\lib\XML\XPath\Node\Text.pm Installing C:\Perl\bin\xpath Installing C:\Perl\bin\xpath.bat Appending installation info to C:\Perl\lib/perllocal.pod
Now you are able to use XML::XPath in a perl (or CGI) script.
code:
#!/Perl use XML::XPath;
Most of the above is concerning installation in Windows, but Ubuntu, and other unix, linux, installation is fairly similar...
To install additional Perl modules from CPAN - see - Installing Perl Modules - basically it is a process of entering the CPAN shell, then typing 'install Bundle::CPAN' to update to the current, then say 'install Probe::Perl Net::IP ...' for any additional modules required.
$ su <root password> # unset LANG # perl -MCPAN -e shell cpan> o conf connect_to_internet_ok 1 (this MAY be required) cpan> install Bundle::CPAN ... there will be lots of display, some long pauses, and some inputs REQUIRED!... cpan> reload cpan cpan> o conf commit cpan> install Probe::Perl cpan> exit
Always hit <Enter> to accept the default when prompted. It can be a long process, with many long pauses. Be patient...
EOF - perl_install.htm