"Undefined subroutine"

Discussion in 'Perl Misc' started by B H, Nov 21, 2004.

  1. B H

    B H Guest

    Trying to use an "old" script which I have not written myself. It has worked
    previously
    under installation on other machines (with possible older versions of Perl).
    The problem is that I do not remember all the modules I loaded and which
    modifications I
    did in order to make it work last time.
    I have used CPAN and made and installed URI (at least I think I did it), but
    I do not
    know if this is enough.
    I still get the following error:
    ===
    Undefined subroutine &URI::URL called at /home/c4n/bin/<scriptname> line
    488.

    Line 488:

    my $urlobj = new URI::URL( $values[$i], $self->{'url'} );
    ===
    I am not experienced in Perl, so maybe the error is obvious. But now I am
    tired of banging my head against the wall.
    Could there be problems related to a possible change of version of Perl
    since
    I last used this script?
    Can I have done something wrong during CPAN-download ( I did make, test
    and install)?
    Something else?

    Borge
    B H, Nov 21, 2004
    #1
    1. Advertising

  2. B H

    Jim Keenan Guest

    B H wrote:
    > Trying to use an "old" script which I have not written myself. It has worked
    > previously
    > under installation on other machines (with possible older versions of Perl).
    > The problem is that I do not remember all the modules I loaded and which
    > modifications I
    > did in order to make it work last time.
    > I have used CPAN and made and installed URI (at least I think I did it), but
    > I do not
    > know if this is enough.
    > I still get the following error:
    > ===
    > Undefined subroutine &URI::URL called at /home/c4n/bin/<scriptname> line
    > 488.
    >
    > Line 488:
    >
    > my $urlobj = new URI::URL( $values[$i], $self->{'url'} );
    > ===


    Assuming you have correctly installed the latest version of URI, call

    perldoc URI

    This shows the documentation. I infer from a note in the
    "Authors/Acknowledgments" section that this module supercedes the older
    URI::URL module. I also fail to find a &URL in the current version. So
    that explains why you get the "undefined subroutine" error.

    I recommend studying the documentation for URI and and recoding your
    script as needed.

    Jim Keenan
    Jim Keenan, Nov 21, 2004
    #2
    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. Mark
    Replies:
    0
    Views:
    481
  2. Replies:
    4
    Views:
    175
    Bob Walton
    Aug 12, 2003
  3. Torsten Mangner

    testing for 'undefined subroutine'

    Torsten Mangner, Nov 4, 2003, in forum: Perl Misc
    Replies:
    3
    Views:
    138
    Bob Walton
    Nov 5, 2003
  4. Moulin Kluge
    Replies:
    2
    Views:
    333
    pkent
    Jan 27, 2004
  5. Dan Burke
    Replies:
    6
    Views:
    198
    Dan Burke
    Jul 5, 2004
Loading...

Share This Page