1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Perl can't open any sockets or use net??

Discussion in 'Linux & Open Source' started by growse, 10 Jul 2006.

  1. growse

    Soldato

    Joined: 18 Oct 2002

    Posts: 7,139

    Location: Ironing

    Right, got a gentoo system, everything works properly except (apparently) for Perl. A bunch of stuff which relies on perl doesn't seem to be able to do simple stuff like open connections to servers, open sockets etc.

    I've a pop3 program which hsa this:
    Code:
    use Net::POP3;
    $pop = Net::POP3->new('mail.domain.com') || die("unable to connect\n");
    
    and always dies on that line. I can connect to mail.domain.com, the script can't though. Doesn't make any difference if I use the IP either.

    Similarly, Razor2 can't create a startup config as it can't connect to the right server:
    Code:
    Jul 10 15:29:12.685675 admin[24614]: [ 6] No port specified, using 2703
    Jul 10 15:29:12.685765 admin[24614]: [ 5] Connecting to discovery.spamnet.com ...
    Jul 10 15:29:12.689887 admin[24614]: [ 3] Unable to connect to discovery.spamnet.com:2703; Reason: .
    Jul 10 15:29:12.690111 admin[24614]: [ 5] Razor Discovery Server discovery.spamnet.com is unreachable
    Jul 10 15:29:12.690350 admin[24614]: [ 1] razor-admin error: nextserver: Bootstrap discovery failed. Giving up.
    
    Thing is, it is reachable. I can telnet into that address on that port. The script that's running it (guessing perl here) can't!

    Also, starting spamd:
    Code:
     * Starting spamd ...
    [24745] warn: Use of uninitialized value in getprotobynumber at /usr/lib/perl5/5.8.8/IO/Socket/INET.pm line 134.
    [24745] warn: Use of uninitialized value in socket at /usr/lib/perl5/5.8.8/i686-linux/IO/Socket.pm line 80.            [ ok ]
    
    Not an error, but evidence that something's up with this. Should I downgrade perl? Uninstall it and reinstall? I've reinstalled over the top of the current, but not hard uninstall/reinstalled for fear of actually breaking something.

    Any ideas?
     
  2. EKsparky

    Associate

    Joined: 16 Sep 2005

    Posts: 93

    Have you checked the path is correct #!/usr/bin/perl
    just a thought
     
  3. growse

    Soldato

    Joined: 18 Oct 2002

    Posts: 7,139

    Location: Ironing

    Yup. Otherwise no script would run at all...