[techtalk] perl modules

Jeff Frasca phaedrus at thereactor.cleptoscastle.com
Sat May 20 16:44:35 EST 2000


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, 20 May 2000, Lori wrote:

> Can some of you perl ppl out there point me in the right direction?  I
> decided I would like to install a perl module I downloaded from CPAN,
> that for some reason did not come with my install: Apache::Debug.
> Once before I just stuck a .pm file to use on an ISP's server, no
> problem.  But this, I am trying to install on my own server, and in
> the tarball was a file 'Makefile.PL' with this

Makefile.PL is a handy way of creating a Makefile with perl.  

> and also a 'test.pl' file with this:
> ----------------------------------------------------
> # Before `make install' is performed this script should be runnable with
> # `make test'. After `make install' it should work as `perl test.pl'
> 
> ######################### We start with some black magic to print on failure.
> 
> # Change 1..1 below to 1..last_test_to_print .
> # (It may become useful if the test is moved to ./t subdirectory.)
> 
> print "no tests...\n";

Boy oh boy, isn't that cute! ;)  I guess they are predicting they will
need to test the system to make sure it works at some later date.  Right
now, it appears they don't have any tests to perform.  You can safely
ignore this file for now.

> 
> ######################### End of black magic.
> 
> # Insert your test code below (better if it prints "ok 13"
> # (correspondingly "not ok 13") depending on the success of chunk 13
> # of the test code):
> ----------------------------------------------------
> 
> Typing either make or 'make test' gives me "no target" or "nothing to
> do" sorts of errors, and I really don't know what I'm doing at this
> point - I still feel lucky to get rpm's installed.  I've used 'make
> install' on some apps before, but not with perl stuff.  I tried just
> taking the file DebugInfo.pm, sticking it in the dir with all the
> other Apache *.pm's.  I made sure it had same permissions as the other
> ones.  Then when calling it I get a "undeclared variable" error from
> the module itself, when using it in a script.  So at least perl can
> find the module, right?  I'm trying to use it to debug another script

Right, so since it doesn't seem they put any configuration code in
there, there is probably something wrong with the module itself.  It
sounds like someone `use strict;'ed and misspelled a variable name, or
didn't use my() on the variable name.  Go poke around and look to see
where the variable should be defined, and define it.  See what happens.
:)

> that isn't working, but I don't understand this Makefile stuff.  Do I
> really need to do it?

Yes, you probably need to do the make stuff -- or at least to get into
the habit, most modules actually use the Makefile to do configuration
stuff or check for dependencies, this one doesn't seem to, but stil...
Besides, Makefiles are actually rather cool things.  Basically, make is
a program that will run what is specified in the Makefile.  The cool
thing about Make is that it can tell which files have been updated and
which ones haven't, which means when you are debugging a C program with
lots of files, only the files you have changed get recompiled.  You can
also get it to do just about anything.  

In the Makefile, there are a bunch of definitions for `targets'.  I've
got some simple Makefiles if you want to see some good examples.  make
is an unbelievably handy tool, because you don't just have to use it for
programming.

to solve the problem you're having right now, try running (you might
even want to untar the the archive again to get a fresh tree): 
perl Makefile.pl 
make 
make install 

> 
> Tune in next week when I try to get DSO modules working... if you know of a
> complete newbies guide to installing stuff like this let me know!

Just about everything comes with a README & INSTALL file.  Learn to love
reading them, because they will tell you what you need to know to get
something installed.  Also, learn how to use the tools the people
distributing the software are using for installing, this means if what
they wrote is boogered-up, doesn't work for your distro for some reason
or another, you can get in there and fix it.  This is the harsh reality
of using tarballs and beta software.

Jeff

My Geekcode has moved to my .plan file.
finger phaedrus at 24.5.73.229 for that and other Junk

My Public Key -- http://24.5.73.229/pubkey.txt 


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (GNU/Linux)
Comment: Made with pgp4pine 1.75

iD8DBQE5JyNm7sVCtrzVTMERAjXmAJ0ZUTgOiehZsizte5rYNslclAl+fgCfVPoM
Qf28Wysqq3chWLYpPfS61P8=
=6xA8
-----END PGP SIGNATURE-----







More information about the Techtalk mailing list