in reply to Re: Re: Re: Netstat summary and Perl?
in thread Netstat summary and Perl?

I hope this isn't homework!

Rofl! I wasn't looking for code or the solution actually. I started by asking if there was a Perl module that would be able to pull netstat information. Summary information at that. I was hoping to stay away from calling netstat and grepping / pattern matching. This way I could use the same code on just about any machine running Perl.

I recommend you sit down and develop your requirements thoroughly and then plan your attack rather than fit your requirements to your attack

Understood. I wasn't sure how much Perl could do for me in this case. Calling netstat and grepping works for me. Normally I would do it with grep/sed/awk in a shell script. :-)

  • Comment on Re: Re: Re: Re: Netstat summary and Perl?

Replies are listed 'Best First'.
Re:^5 Netstat summary and Perl?
by blue_cowdawg (Monsignor) on Apr 07, 2004 at 18:35 UTC

        Normally I would do it with grep/sed/awk in a shell script.

    Sure you could. Buy why? You can do that in Perl without spawning off a process for each grep/sed/awk operation I am performing. Comparision:

    netstat -s | grep 'Trans' | awk '{... ehh... whatever...
    just used three processes...
    open PIPE... whatever... my @line = grep 'Trans',<PIPE>; close PIPOE
    used two. I know that is a weak example, but I hope it clarifies my position.

    Plan your work... work your plan...