URI::URL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fritz Bayer

    URI::URL

    Hi,

    I get the following error:

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

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

    Fritz
  • Gunnar Hjalmarsson

    #2
    Re: URI::URL

    Fritz Bayer wrote:[color=blue]
    > I get the following error:
    >
    > Can't locate object method "host" via package "URI::_gene ric"
    >
    > This error occurs randomly. What't the reason for that?[/color]



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

    Comment

    • Fritz Bayer

      #3
      Re: URI::URL

      Gunnar Hjalmarsson <noreply@gunnar .cc> wrote in message news:<ihnXc.101 861$dP1.358640@ newsc.telia.net >...[color=blue]
      > Fritz Bayer wrote:[color=green]
      > > I get the following error:
      > >
      > > Can't locate object method "host" via package "URI::_gene ric"
      > >
      > > This error occurs randomly. What't the reason for that?[/color]
      >
      > http://www.catb.org/~esr/faqs/smart-questions.html[/color]

      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?

      Comment

      • Gunnar Hjalmarsson

        #4
        Re: URI::URL

        Fritz Bayer wrote:[color=blue]
        > Gunnar Hjalmarsson wrote:[color=green]
        >> Fritz Bayer wrote:
        >>[color=darkred]
        >>> I get the following error:
        >>>
        >>> Can't locate object method "host" via package "URI::_gene ric"
        >>>
        >>> This error occurs randomly. What't the reason for that?[/color]
        >>
        >> http://www.catb.org/~esr/faqs/smart-questions.html[/color]
        >
        > 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?[/color]

        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

        Comment

        Working...