Dear brothers and sisters in Perl,
I'm rewriting an existing codelet that nails up a dial connection via HTTP fetches, so that it randomly selects from a list of web pages to fetch and waits a random length of time between fetches.   All fairly straightforward and no problems.   That is, until I move the code from my workstation to the dial-connected firewall/proxy, where it fails to run and gives this error:

Can't locate object method "new" via package "URI::URL" at ./wtest.pl line 12

I've reinstalled URI, downgraded it to v1.17, upgraded it back to v1.18, all to no avail.   It can't be left to run on my workstation, as it would only fetch from firewall's proxy instead of from the web.   What other troubleshooting steps might you recommend?

Minimized code and additional details follow.
    stymied, puzzled, baffled and perplexed,
    Don

#!/usr/bin/perl -w # wtest.pl # 2002-04-16 ybiC $|++; require 5; use strict; use LWP::UserAgent; my $site = shift; my $url = new URI::URL($site); my $req = new HTTP::Request('GET', $url); my $ua = new LWP::UserAgent; my $resp = $ua->request($req); if ($resp->is_success) { # print $resp->content; print "Received response from $site\n"; } else { print "Error: ", $resp->message, "\n\n"; }

Relevant modules (all installed without a hitch):

@INC contains the following:

Perl 5.00503
Debian GNU/Linux 2.2r6


In reply to Can't locate object method new via package URI::URL by ybiC

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.