Solved

Handleing Web pages (Without actual installing CPAN)

Posted on 2001-06-05
7
155 Views
Last Modified: 2010-03-05
Hi,

I work with unix,
If I understood correctly, To install Cpan modules -
I should be an administrator (and I'm not).

In order to "use Telnet" I took the file Telnet.pm and
Included in @INC the directory that contained the file.
It worked - without installing CPAN.

I'd like to write a perl script that handles web pages.
Perl cookbook offers the use of those modules:
LWP::Simple;    ,   LWP::UserAgent;
URI::URL;         ,   HTTP::Request;
I tied to use: lcwa-1.0.0/ library (took it from cpan.org) but
Without compiling CPAN I get Errors "Can't find func...".

Could you please offer me a solution ?
Either:
a) How to use the *.pm files without installing - so
    It would work (unfortunatly each file uses other files
    using "use" and "require"..... I tried gathering the files
    the modules require in same library, then gave the same
    tree of directories, but it didn't work for me).
Or
b) A way to handle Web pages without CPAN functions
   (a demo script???).
   I'd like to be able to send data & read a page in order
   to analyze the text in the page.

Thanks,
Ronen.
0
Comment
Question by:ronenla
  • 3
  • 2
  • 2
7 Comments
 
LVL 8

Expert Comment

by:shlomoy
ID: 6156235
you can install CPAN modules and not be a superuser.
You can install them locally.

When you download a CPAN module and you untar/ungzip it you should read the INSTALL and README files to learn how to install it locally for your own use.
0
 
LVL 8

Expert Comment

by:shlomoy
ID: 6156318
If you want to install a private copy of libwww-perl in your home
directory, then you should try to produce the initial Makefile with
something like this command:

  perl Makefile.PL LIB=~/perl
                                     
0
 
LVL 5

Expert Comment

by:Sapa
ID: 6156321
"If I understood correctly, To install Cpan modules -
I should be an administrator (and I'm not)."

You can correctly install CPAN modules into any directory where you have enough rights to write, (usually somewhere in your home directory). Example:

gzip -cd libwww-perl-5.48.tar.gz | tar xvf -
cd libwww-perl-5.48
perl Makefile.PL LIB=/home/ronenla/perl
make
make install

and then use it like:

#!/usr/bin/perl
use lib '/home/ronenla/perl';
use LWP::UserAgent;
use HTTP::Request;
...


- Sapa

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:ronenla
ID: 6156347
Shlomoy,
I already tried this option:
perl Makefile.PL LIB=~/my_dir
but it didn't work. I got those Errors:
syntax error in file Makefile.PL at line 4, next 2 tokens "use ExtUtils"
syntax error in file Makefile.PL at line 14, next 2 tokens "\MY:"

So I still need:

Either:
Help to locally install CPAN LWP lib
Or:
A demo script how to get a web page and analyze it.

Ronen.

0
 
LVL 5

Accepted Solution

by:
Sapa earned 250 total points
ID: 6156372
ronenla:

it seems like the '~' character was expanded incorrectly. Try my example.

- Sapa
0
 

Author Comment

by:ronenla
ID: 6156375
Shlomoy,
I already tried this option:
perl Makefile.PL LIB=~/my_dir
but it didn't work. I got those Errors:
syntax error in file Makefile.PL at line 4, next 2 tokens "use ExtUtils"
syntax error in file Makefile.PL at line 14, next 2 tokens "\MY:"

So I still need:

Either:
Help to locally install CPAN LWP lib
Or:
A demo script how to get a web page and analyze it.

Ronen.

0
 

Author Comment

by:ronenla
ID: 6156421
Shlomoy,
I already tried this option:
perl Makefile.PL LIB=~/my_dir
but it didn't work. I got those Errors:
syntax error in file Makefile.PL at line 4, next 2 tokens "use ExtUtils"
syntax error in file Makefile.PL at line 14, next 2 tokens "\MY:"

So I still need:

Either:
Help to locally install CPAN LWP lib
Or:
A demo script how to get a web page and analyze it.

Ronen.

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now