Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > URI::URL

Reply
Thread Tools

URI::URL

 
 
Fritz Bayer
Guest
Posts: n/a
 
      08-26-2004
Hi,

I get the following error:

Can't locate object method "host" via package "URI::_generic"

This error occurs randomly. What't the reason for that?

Fritz
 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      08-26-2004
Fritz Bayer wrote:
> I get the following error:
>
> Can't locate object method "host" via package "URI::_generic"
>
> This error occurs randomly. What't the reason for that?


http://www.catb.org/~esr/faqs/smart-questions.html

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
 
 
 
Fritz Bayer
Guest
Posts: n/a
 
      08-27-2004
Gunnar Hjalmarsson <(E-Mail Removed)> wrote in message news:<ihnXc.101861$(E-Mail Removed)>...
> Fritz Bayer wrote:
> > I get the following error:
> >
> > Can't locate object method "host" via package "URI::_generic"
> >
> > This error occurs randomly. What't the reason for that?

>
> http://www.catb.org/~esr/faqs/smart-questions.html


Well I already googled quite a bit but it did not help. I have already
updated all the perl libraries.

If the question was not clear enough let me try to repeat this. I'm
basically fetching pages from the web containing links.

Those links I store in URI objects, which I collect in a large list.
This list I later walk though printing out each object calling the
following function:

foreach $uri (@uris)
{
print $uri->host() . "\n";
}

Sometimes I get the error above. If I call the perl script again, on
the same page, then all of a sudden it works.

So it occurs randomly, sometimes and I can't reproduce it. I thought
it has something to do with the network.

But this can't be since the fetching occurs earlier and the call
$uri->hsot() does not involve the network.

In the vey beginning it would not even allow me to call the host()
function, but after updating the modules over the cpan console that
got fixed.

So I really have no clue what it could be. My last thought was, that I
pass in some invalid argument, for ex an invalid URL so that its not
possible to call the host() function?
 
Reply With Quote
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      08-27-2004
Fritz Bayer wrote:
> Gunnar Hjalmarsson wrote:
>> Fritz Bayer wrote:
>>
>>> I get the following error:
>>>
>>> Can't locate object method "host" via package "URI::_generic"
>>>
>>> This error occurs randomly. What't the reason for that?

>>
>> http://www.catb.org/~esr/faqs/smart-questions.html

>
> Well I already googled quite a bit but it did not help. I have
> already updated all the perl libraries.
>
> If the question was not clear enough let me try to repeat this. I'm
> basically fetching pages from the web containing links.
>
> Those links I store in URI objects, which I collect in a large
> list. This list I later walk though printing out each object
> calling the following function:
>
> foreach $uri (@uris)
> {
> print $uri->host() . "\n";
> }
>
> Sometimes I get the error above. If I call the perl script again,
> on the same page, then all of a sudden it works.
>
> So it occurs randomly, sometimes and I can't reproduce it. I
> thought it has something to do with the network.
>
> But this can't be since the fetching occurs earlier and the call
> $uri->hsot() does not involve the network.
>
> In the vey beginning it would not even allow me to call the host()
> function, but after updating the modules over the cpan console that
> got fixed.
>
> So I really have no clue what it could be. My last thought was,
> that I pass in some invalid argument, for ex an invalid URL so that
> its not possible to call the host() function?


If you really want to have somebody help you, I suggest that you write
a small but *complete* program that people can copy and run, and that
behaves the way you describe.

You should also note that this group is defunct, with only a handful
readers, so you'd better post the program to comp.lang.perl.misc instead.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments