in reply to Net::FTP force IPV4

Per the documentation:

Domain - Domain to use, i.e. AF_INET or AF_INET6. This argument will be passed to the IO::Socket super class. This can be used to enforce IPv4 even with IO::Socket::IP which would default to IPv6. Family is accepted as alternative name for Domain.

So, something like:

my $ftp = Net::FTP->new ('ftp.foo.com', Domain => AF_INET);

🦛

Replies are listed 'Best First'.
Re^2: Net::FTP force IPV4
by averlon (Sexton) on Jun 27, 2023 at 09:20 UTC
    I already tried this!

    Result: Bareword "AF_INET" not allowed while "strict subs" in use at

    Regards Kallewirsch

      You need to import AF_INET:

      use IO::Socket qw(AF_INET);
        thanks - this did the trick!
        Regards Kallewirsch