perl -i -p -e 's/contacts.html/contacts.shtml/g' *.html
There are 3 things that will make your use of CPAN better:
export FTP_PASSIVE=1
Under Mac OS X, Perl is already installed, with several modules in various places. It's not clear how to cleanly add more modules in a CPAN-like way, so I created a fresh CPAN repository in ~/root/cpan. This will cause duplicate packages to be loaded, but I don't know a better way. Sigh. Once done, you have to tell the installed Perl to add your CPAN modules to the @INC variable, with something like
This almost worked - something is still screwy - it couldn't find Event.pm.export PERL5LIB=/Users/siemsen/.cpan/build/Tk-804.027
You can load modules from the CPAN 3 ways:
Use the CPAN.pm module. To read about it, do "perldoc CPAN", or in XEmacs use the Perldoc pull-down when you're editing a Perl file.
The first time you use CPAN.pm, it will ask a long series of questions, the answers for which can be found below. Don't answer them until you've installed ncftp on the local machine.
If you've already installed CPAN and just want to use it, do like(as root) (sudo) perl -MCPAN -e shell install Log::Log4perl install HTML::TokeParser::Simple h q
The above will install Log4perl in /usr/lib/perl5/site_perl/5.6.1/Log/Log4perl.
I've had it happen that after a successful install like the
above (no failure messages during the install) a Perl program
still coudn't find the module. The .pm file
was there, and in a directory listed in Perl's INC paths, but I
still got the
"Can't locate xyz.pm in @INC"
message. It turned out that some of the intermediate
directories above the .pm file were protected
without 'x', so I didn't have permissions to read the
directories. To fix it at the time, I did
(as root)
find /usr/local/lib/site_perl -type d -exec chmod +x {} \;
The CPAN.pm module will store modules in, like, /usr/local/lib/perl5/site_perl/5.8.4, with your version of perl. If you run CPAN.pm with a different version of perl, modules will get stored in a different place.
The CPAN module stores information about what's installed in a .cpan directory. Be careful about having multiple such directories laying around. Ideally, you want one of them on your machine.
Some Perl modules contain C code. When you install them, they'll try to compile the code. On Solaris, by default, you may try to use cc, which on Solaris is /usr/ucb/cc, which is a script, not a C compiler, and will fail miserably. I had success replacing /usr/ucb/cc with a link to gcc, but the more elegant solution is ...?
The first time you use CPAN.pm, it will ask a long series of questions. A couple of them are very important:
Where should I put the CPAN repositoryftp proxy?
to which you should answer "gate.ucar.edu". When it says "if
your proxy is an authenticating proxy, you can set your
username here", leave it blank. It is possible
that someone has already answered incorrectly, in which case
CPAN.pm will use the Net:FTP module to get
things, and Net::FTP won't be configured
correctly so it won't use passive mode, and CPAN will just
hang. To fix this, you may have to find and delete the
Net::FTP module. Search the whole disk for a
file named FTP.pm and delete the entire enclosing directory
named "Net". Then rerun CPAN, install the
Net::FTP module and answer the config
questions.
If CPAN doesn't work or works very slowly, it may be because it can't use LWP or Net::FTP through the firewall. Just wait for it to timeout tryng those two methods, and it'll then try ncftpget, which hopefully will work. To make this process more bearable, reduce the list of mirror sites to just one so you dan't have to wait through lets of timeouts.
To reconfigure CPAN, do
cpan> o conf init
Modules to install include
If you can, find the RPM for the module you want. For instance, to install the Log::Agent module, I did did
rpm -i perl-Log-Agent-0.303-8.noarch.rpm
For example, web to the CPAN. Get p5-Palm-1.2.4.tar.gz. Save it in /usr/src.
cd /usr/src gunzip p5-Palm-1.2.4.tar.gz tar xf p5-Palm-1.2.4.tar rm p5-Palm-1.2.4.tar cd p5-Palm-1.2.4 perl Makefile.PL make make install make clean chown -R siemsen /usr/src/p5-Palm-1.2.4 chgrp -R datacomm /usr/src/p5-Palm-1.2.4
SNMP::Info is layered on top of Net::SNMP, so you first have to install Net::SNMP. When you use apt-get to install the "snmp" package, it'll install the "libsnmp-perl" package, which is the Perl piece of Net::SNMP. This should install SNMP.pm into your Perl system, into, like, /usr/local/share/perl/5.8.4/Net/SNMP.pm. You can then happily use Net::SNMP.
There is no Debian package for SNMP::Info, so you have to install it manually.
as root
cd SNMP-Info-1.04
perl Makefile.PL
make
make install
make clean
I still had problems. Sigh.
/usr/src/p5-Palm-1.2.4/util/pdbdump -nohex ~/pilot/Backup/AddressDB.pdb
To learn about the modules, read, the
Palm::PDB doc page. To look at the same information as text
from within XEmacs, do this:
M-! pod2text /usr/src/p5-Palm-1.2.4/Palm/PDB.pm