URI::URL

Discussion in 'Perl' started by Fritz Bayer, Aug 26, 2004.

  1. Fritz Bayer

    Fritz Bayer Guest

    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
     
    Fritz Bayer, Aug 26, 2004
    #1
    1. Advertising

  2. Gunnar Hjalmarsson, Aug 26, 2004
    #2
    1. Advertising

  3. Fritz Bayer

    Fritz Bayer Guest

    Gunnar Hjalmarsson <> wrote in message news:<ihnXc.101861$>...
    > 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?
     
    Fritz Bayer, Aug 27, 2004
    #3
  4. 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
     
    Gunnar Hjalmarsson, Aug 27, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon Harris
    Replies:
    0
    Views:
    6,420
    Simon Harris
    May 10, 2005
  2. Stanimir Stamenkov
    Replies:
    1
    Views:
    2,495
    Stanimir Stamenkov
    Aug 17, 2005
  3. Pavel
    Replies:
    2
    Views:
    1,684
    Peter Flynn
    Aug 4, 2004
  4. etheriau
    Replies:
    1
    Views:
    679
    Pavel
    Aug 23, 2004
  5. Joe Curry

    Invalid URI: The format of the URI could not be determined.

    Joe Curry, Oct 8, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    360
    Joe Curry
    Oct 8, 2003
Loading...

Share This Page