Complete-Host

 view release on metacpan or  search on metacpan

lib/Complete/Host.pm  view on Meta::CPAN

        for my $prog ("/sbin/ifconfig") {
            next unless -x $prog;
            my @lines = IPC::System::Options::readpipe(
                {lang=>"C"}, "$prog -a");
            next if $?;
            for my $line (@lines) {
                if ($line =~ /^\s*inet addr:(\S+)/) {
                    log_trace("[comphost]   Adding %s", $1) if $COMPLETE_HOST_TRACE;
                    $hosts{$1}++;
                }
                if ($line =~ m!^\s*inet6 addr:\s*(\S+?)(?:/\d+)?(?=\s)!) {
                    log_trace("[comphost]   Adding %s", $1) if $COMPLETE_HOST_TRACE;
                    $hosts{$1}++;
                }
            }
            last IFCONFIG;
        }
    }

    # from SSH known_hosts
    {



( run in 0.278 second using v1.01-cache-2.11-cpan-87723dcf8b7 )