> -----Original Message-----
> From: DanaBarish [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 10, 2002 11:20 AM
> To: [EMAIL PROTECTED]
> Subject: Network programming
> 
> 
> Having unsuccessfully tried to do some network programming 
> with PHP (my current scripting preference) I have turned to 
> perl. My task is to "search" for text in pages on a remote 
> server. I have a list of URLs to be searched. PHP has 
> security issues in this area unfortunately, I assume perl is 
> up to the task. "MadEngine" claims it can do this but support 
> is non-existant and I am getting errors.
> 
> Most script I have seen use IO::socket or LWP::simple to read 
> from remote servers. I have downloaded from CPAN and 
> attempted to install. I need to install to a user directory 
> and used the prefix option on the install. I have now a 
> collection of files with the pm extension in various 
> directories (eg. LWP/Simple.pm). I am unable to follow the 
> rest of the install instructions because they assume too much 
> knowledge. (Instructions follow:)

Don't use IO::Socket. You're on the right track with LWP::Simple,
and LWP has some other classes that give you finer grain control,
like LWP::UserAgent.

> 
> >You install libwww-perl using the normal perl module 
> distribution drill:
> >
> >   perl Makefile.PL
> >  make
> >   make test
> >   make install
> 
> I executed the first instruction with prefix option. The next 
> instruction get error:
> 
> make: *** No targets specified and no makefile found.  Stop.
> 
> regardless of directory. I cannot find any file like 
> "makefile" anywhere in the tree. Am I done? How do I know 
> when I am done? I tried executing a script using LWP 
> unsuccessfully (ERROR_NOTES = Premature end of script 
> headers: /usr/local/etc/httpd/cgi-bin/suid). Script is 
> correctly chmod'd. Perl path is correct.
> 
> My host FAQ says:
> <snip>
> You are welcome to install your own set of additional modules. 
> When you build modules, use the PREFIX option when generating 
> Makefiles: 
> 
> perl Makefile.PL PREFIX=/home/mydir/perl 
> 
> then either set the PERL5LIB environment variable before you 
> run scripts that use the modules/libraries (see the perlrun 
> manpage) or say: 
> 
> use lib '/home/mydir/perl'; 
> 
> <endsnip>
> 
> I put in my unsuccessful script:
> 
> use lib '/home/mydir/LWP/libwww-perl-5.64/lib/LWP';
> 
> which is correct path to simple.pm (mydir substituted with 
> correct username)

No. A prefix is just that: a "base" directory for your "private"
modules. I would suggest you go right with the host faq and create
/home/user/perl. Then untar the distribution in some other directory
(say /home/user/build). Go to /home/user/build and enter:

   perl Makefile.PL PREFIX=/home/user/perl

That should create a Makefile (not makefile) in your /home/user/build
directory. Now you can do:

   make
   make test
   make install

That should drop the files in the right place in directories below
/home/user/perl (e.g. /home/user/perl/LWP/Simple.pm).

Now, in your script:

   use lib '/home/user/perl';
   use LWP::Simple;

should work.

The build/install instructions will be the same no matter what
modules you're installing (i.e. *always* use PREFIX=/home/user/perl
and *always* use lib '/home/user/perl')

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to