in reply to netstat equivalent

Those information netstat printed out are actually accessiable through various c structures. What netstat does is simply present those info visually.

I am not aware of any Perl module wrap those c stuff.

Ib this case, you can simply get what you want thru open3 calls.

One thing important is to always do a waitpid after each open3 call, otherwise you will create lots of zombies.

Replies are listed 'Best First'.
Re: Re: netstat equivalent
by cbro (Pilgrim) on Mar 21, 2003 at 18:24 UTC
    Yeah, I don't think I'm going to find a wrapper either.

    I could write a C program, I just prefer Perl DBI over the MySQL C API.

    I might try doing something like this:

    open(STATUS, "netstat -an 2>&1 |") || die "can't fork: $!";

    ...but, I have not decided yet.

    Well, regardless, thank you both for your responses :-)