PDA

View Full Version : Installing URI::Escape using cpan


max.spicer
2005-10-10, 08:50
I'm trying to install URI::Escape on a linux system in order to use uri_escape and am coming a cropper. I've never really got the hang of cpan and I don't fully understand perl modules, so I'm probably doing something stupid. Could someone help, please?

server:/home/max# cpan URI::Escape
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
Database was generated on Sun, 09 Oct 2005 22:42:30 GMT
Running install for module URI::Escape

The module URI::Escape isn't available on CPAN.

Either the module has not yet been uploaded to CPAN, or it is
temporary unavailable. Please contact the author to find out
more about the status. Try 'i URI::Escape'.

Thanks,

Max

mherger
2005-10-10, 09:03
> I'm trying to install URI::Escape on a linux system in order to use
> uri_escape and am coming a cropper. I've never really got the hang of
> cpan and I don't fully understand perl modules, so I'm probably doing
> something stupid. Could someone help, please?

Isn't it installed by default? If not, I'm pretty sure your distribution
has a package for this.

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
SlimString Translation Helper (http://www.herger.net/slim/)

max.spicer
2005-10-10, 09:15
perl -MURI::Escape -e 1
Can't locate URI/Escape.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .).
BEGIN failed--compilation aborted.

Thanks for the tip on packages, libcgi-perl includes it. However, the original question still stands. How would I install it with CPAN?

Thanks,

Max

> I'm trying to install URI::Escape on a linux system in order to use
> uri_escape and am coming a cropper. I've never really got the hang of
> cpan and I don't fully understand perl modules, so I'm probably doing
> something stupid. Could someone help, please?

Isn't it installed by default? If not, I'm pretty sure your distribution
has a package for this.

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
SlimString Translation Helper (http://www.herger.net/slim/)

Victor Brilon
2005-10-10, 09:25
I think that module is part of LWP , isn't it?
http://search.cpan.org/search?module=URI::Escape

Victor

On Oct 10, 2005, at 10:15 AM, max.spicer wrote:

>
> perl -MURI::Escape -e 1
> Can't locate URI/Escape.pm in @INC (@INC contains: /etc/perl
> /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5
> /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8
> /usr/local/lib/site_perl .).
> BEGIN failed--compilation aborted.
>
> Thanks for the tip on packages, libcgi-perl includes it. However, the
> original question still stands. How would I install it with CPAN?
>
> Thanks,
>
> Max
>
> mherger Wrote:
>
>>> I'm trying to install URI::Escape on a linux system in order to use
>>> uri_escape and am coming a cropper. I've never really got the hang
>>>
>> of
>>
>>> cpan and I don't fully understand perl modules, so I'm probably
>>>
>> doing
>>
>>> something stupid. Could someone help, please?
>>>
>>
>> Isn't it installed by default? If not, I'm pretty sure your
>> distribution
>> has a package for this.
>>
>> --
>>
>> Michael
>>
>> -----------------------------------------------------------
>> Help translate SlimServer by using the
>> SlimString Translation Helper (http://www.herger.net/slim/)
>>
>
>
> --
> max.spicer
>
> The wild things roared their terrible roars and gnashed their terrible
> teeth
> and rolled their terrible eyes and showed their terrible claws
> but Max stepped into his private boat and waved good-bye
>

max.spicer
2005-10-10, 10:18
What does that mean? I'm very new to Perl, so feel free to talk slowly and loudly! I thought I could use cpan to install any module that they had. Is this not the case?

Max

I think that module is part of LWP , isn't it?
http://search.cpan.org/search?module=URI::Escape

MrC
2005-10-10, 10:32
Max - you can use CPAN to install directly. Some modules depend on other modules when intalling, and as such are requested for inclusion during the install (eg. the LWP module depends on URI::Escape).

You can simply run CPAN and install the module you want.

First, be sure it does not yet exist. As root, enter CPAN interactively. Then, enter the

i URI::Escape

command to see info about the module. If the module is installed, the last two lines of the output will be: something like:

INST_FILE /usr/local/lib/perl5/site_perl/5.8.5/URI/Escape.pm
INST_VERSION 3.28

This is the location and version of your module. If it does exist on your system, and you're not finding it, then you likely have a permissions problem in that it was installed with root permissions, but not group-other permissions. A change or permissions on all the files included with URI::Escape will solve the problem.

If the module is not installed, as root and with a umask of 022, install the module.

su - root
umask 022
cpan
install URI::Escape

Victor Brilon
2005-10-10, 10:32
Type this is in as root:
perl -MCPAN -e shell

That'll give you the CPAN prompt. From there, type in:
install LWP

And answer any questions it asks about dependencies and such. That's
it :)

Victor

On Oct 10, 2005, at 11:18 AM, max.spicer wrote:

>
> What does that mean? I'm very new to Perl, so feel free to talk
> slowly
> and loudly! I thought I could use cpan to install any module that
> they
> had. Is this not the case?
>
> Max
>
> Victor Brilon Wrote:
>
>> I think that module is part of LWP , isn't it?
>> http://search.cpan.org/search?module=URI::Escape
>>
>>
>
>
> --
> max.spicer
>
> The wild things roared their terrible roars and gnashed their terrible
> teeth
> and rolled their terrible eyes and showed their terrible claws
> but Max stepped into his private boat and waved good-bye
>

max.spicer
2005-10-10, 10:43
Have a look at my original posts in this thread. It wasn't installed, and cpan install URI::Escape failed - all the logs are in the posts. I had this last time I tried to use cpan to install something, but on a completely different server. I'm guessing I'm doing something stupid.

Thanks,

Max

Max - you can use CPAN to install directly. Some modules depend on other modules when intalling, and as such are requested for inclusion during the install (eg. the LWP module depends on URI::Escape).

You can simply run CPAN and install the module you want.

First, be sure it does not yet exist. As root, enter CPAN interactively. Then, enter the

i URI::Escape

command to see info about the module. If the module is installed, the last two lines of the output will be: something like:

INST_FILE /usr/local/lib/perl5/site_perl/5.8.5/URI/Escape.pm
INST_VERSION 3.28

This is the location and version of your module. If it does exist on your system, and you're not finding it, then you likely have a permissions problem in that it was installed with root permissions, but not group-other permissions. A change or permissions on all the files included with URI::Escape will solve the problem.

If the module is not installed, as root and with a umask of 022, install the module.

su - root
umask 022
cpan
install URI::Escape

max.spicer
2005-10-10, 10:44
But how should I know to install LWP rather than URI::Escape?

Max

Type this is in as root:
perl -MCPAN -e shell

That'll give you the CPAN prompt. From there, type in:
install LWP

And answer any questions it asks about dependencies and such. That's
it :)

Victor

On Oct 10, 2005, at 11:18 AM, max.spicer wrote:

>
> What does that mean? I'm very new to Perl, so feel free to talk
> slowly
> and loudly! I thought I could use cpan to install any module that
> they
> had. Is this not the case?
>
> Max
>
> Victor Brilon Wrote:
>
>> I think that module is part of LWP , isn't it?
>> http://search.cpan.org/search?module=URI::Escape
>>
>>
>
>
> --
> max.spicer
>
> The wild things roared their terrible roars and gnashed their terrible
> teeth
> and rolled their terrible eyes and showed their terrible claws
> but Max stepped into his private boat and waved good-bye
>

MrC
2005-10-10, 10:46
But how should I know to install LWP rather than URI::Escape?

Max
You don't without experience, and the advice was a little misguided. LWP is yet another module that's commonly used. Just install the module that you want.

Victor Brilon
2005-10-10, 10:50
Look at the URL I sent you: http://search.cpan.org/search?
module=URI::Escape
You can search that site for module info.

But in general, you don't need to do that. In 99% of the time, the
CPAN installer is smart enough to know when a module is a subset of
some package and install that whole package.

Victor

On Oct 10, 2005, at 11:44 AM, max.spicer wrote:

>
> But how should I know to install LWP rather than URI::Escape?
>
> Max
>
> Victor Brilon Wrote:
>
>> Type this is in as root:
>> perl -MCPAN -e shell
>>
>> That'll give you the CPAN prompt. From there, type in:
>> install LWP
>>
>> And answer any questions it asks about dependencies and such. That's
>> it :)
>>
>> Victor
>>
>> On Oct 10, 2005, at 11:18 AM, max.spicer wrote:
>>
>>
>>>
>>> What does that mean? I'm very new to Perl, so feel free to talk
>>> slowly
>>> and loudly! I thought I could use cpan to install any module that
>>> they
>>> had. Is this not the case?
>>>
>>> Max
>>>
>>> Victor Brilon Wrote:
>>>
>>>
>>>> I think that module is part of LWP , isn't it?
>>>> http://search.cpan.org/search?module=URI::Escape
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> max.spicer
>>>
>>> The wild things roared their terrible roars and gnashed their
>>>
>> terrible
>>
>>> teeth
>>> and rolled their terrible eyes and showed their terrible claws
>>> but Max stepped into his private boat and waved good-bye
>>>
>>>
>
>
> --
> max.spicer
>
> The wild things roared their terrible roars and gnashed their terrible
> teeth
> and rolled their terrible eyes and showed their terrible claws
> but Max stepped into his private boat and waved good-bye
>

MrC
2005-10-10, 10:52
Have a look at my original posts in this thread. It wasn't installed, and cpan install URI::Escape failed - all the logs are in the posts. I had this last time I tried to use cpan to install something, but on a completely different server. I'm guessing I'm doing something stupid.

I read the posts completely and understood the problem. You error only indicated the module could not be found in the INC path, not that it didn't exist. Unfortunately, the error message for uninstalled module and incorrectly installed module is exactly the same. So, you have to determine which problem it is.

max.spicer
2005-10-10, 10:56
The error message when I tried to use cpan implied that the module simply wasn't in cpan:

---
The module URI::Escape isn't available on CPAN.

Either the module has not yet been uploaded to CPAN, or it is
temporary unavailable. Please contact the author to find out
more about the status. Try 'i URI::Escape'.
---

But 'i URI::Escape' listed it quite happily. This is the bit that I don't understand. Needless to say, attempts to use the module failed with a compilation error.

Max

I read the posts completely and understood the problem. You error only indicated the module could not be found in the INC path, not that it didn't exist. Unfortunately, the error message for uninstalled module and incorrectly installed module is exactly the same. So, you have to determine which problem it is.

MrC
2005-10-10, 11:05
Why you weren't able to find the module that instant is a mystery. Its there.

Here's the deal. CPAN is simply as set of perl modules that helps download and install other perl modules. its also a database that tracks their version numbers and dependencies.

Your CPAN module is having trouble running, because it is currently requiring the very module you cannot find (URI::Escape).

The question is - why is that module missing / inacessible on your system? What we have not established is which of these is the problem - is it missing, or is it inaccessible?

As root, use the find command to verify this:

find / -name Escape.pm -ls

and see what comes back. This will give you all the Escape.pm files found, and their permissions. If it is found, and the permissions are restrictive, you know the problem. If it is not found anywhere, you can manually install by downloading the software in some directory, unpacking it, and running

su - ; umask 022; perl Makefile.pl; make; make test; make install

Dan Sully
2005-10-10, 11:41
FYI - we include URI::Escape in the CPAN/ directory.

-D
--
Sir, are you classified as human?
Uhh, negative, I am a meat popsicle.

max.spicer
2005-10-10, 11:53
I know, this is non-slim related Perl. It's all part of learning Perl for Slim's benefit though. ;-)

Max

FYI - we include URI::Escape in the CPAN/ directory.

-D
--
Sir, are you classified as human?
Uhh, negative, I am a meat popsicle.