WintersMystic has asked for the wisdom of the Perl Monks concerning the following question:

ok, ive never heard of this. i get this error on a script i wrote for a webtv user friend to get the source, links and img urls of a web page. it workd for me and him and then when others started using it, bam this error

Software error: Can't locate URI/ in @INC (@INC contains: /usr/local/lib/perl5/5.00502/sun4-solaris /usr/local/lib/perl5/5.00502 /usr/local/lib/perl5/site_perl/5.005/sun4-solaris /usr/local/lib/perl5/site_perl/5.005 .) at (eval 15) line 2. For help, please send mail to the webmaster (, giving this error message and the time and date of the error. Content-type: text/html

anyone know what this means???
any help GREATLY apreciated.

2002-01-03 Edit by Corion : Closed open CODE tag

Replies are listed 'Best First'.
Re: ??
by Trimbach (Curate) on Jan 03, 2002 at 09:37 UTC
    What it means is that your program uses a module named "" and that it isn't available on the server that your script is running. When you say "it worked for me and him" do you mean it worked on your server, but when others started using it (on other servers) it breaks? That's not a surprise as I don't think URI::javascript is part of a standard Perl install which means everyone who wants to use your program will also need that module installed.

    Gary Blackburn
    Trained Killer

Re: ??
by vek (Prior) on Jan 03, 2002 at 09:47 UTC
    This typically means that you don't have the URI::javascript module installed on that box - or have it installed in a "non-standard" location. You must have this line of code in your prog:
    use URI::javacript;
    Perl will search through it's list of library directories (contained in the @INC array) to try and locate that module. If it can't find it (as is the case here) then you'll get an error.

    I'm assuming this is a module you wrote yourself as I could not find it on CPAN. That being the case, have you installed it in a directory other than those specified in @INC? If you have, you'll need to add that directory to @INC, here's one possible way to do that:
    use lib '/path-to/your-module'; use URI::javascript;
    Type perl -V to display the library directories perl will search to find installed modules.
Re: ??
by IlyaM (Parson) on Jan 03, 2002 at 17:37 UTC
    Seems like your code uses old version of URI. Do you create URI objects for all extracted links? Upgrade to latest version of URI. Old versions fail on code like:
    my $u = new URI ('javascript:something');

    Ilya Martynov (

Re: ??
by belg4mit (Prior) on Jan 03, 2002 at 11:34 UTC
    Can you get isolate the requests that incurr this message form the access log? I have a hunch that might be enlightening or at least helpful for us...

    perl -pe "s/\b;([st])/'\1/mg"

Re: ??
by WintersMystic (Novice) on Jan 03, 2002 at 10:11 UTC
    actualy, i have never heard of nor used this module in my life. when i mean it workd on my server and his server, it worked. until he started letting others use it on his server.

    i wonder if its possible if he added some JS to the cgi result page and that is somehow conflicting. ill ask him. thank you all :D

Re: ??
by miyagawa (Chaplain) on Jan 03, 2002 at 22:23 UTC
    You'd better comment out use CGI::Carp qw(fatalsToBrowser); in your script.

    fatalsToBrowser installs new $SIG{__DIE__} to your script, thus do harm with eval codes. I guess URI module does try to require URI::javascript with eval() in vain.

    Tatsuhiko Miyagawa