Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Handleing Web pages (Without actual installing CPAN)

Posted on 2001-06-05
7
Medium Priority
?
167 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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 1000 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 Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…
Six Sigma Control Plans

618 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