Re: Module to pull Netstat summary information?

2004-02-28 Thread WC -Sx- Jones
R. Joseph Newton wrote: In Perl, every method has aan implicit argument list, which may be empty. DoinK! :) So, since it is implied - you don't need it. My orginal code fragment was &print_if_Fatal if (system("netstat -nr") / 256); Your version print_if_Fatal() if (system("netstat -nr") / 25

Re: Module to pull Netstat summary information?

2004-02-28 Thread R. Joseph Newton
WC -Sx- Jones wrote: > R. Joseph Newton wrote: > > &print_if_Warn if (system("nstat -a") / 256); > > &print_if_Fatal if (system("netstat -nr") / 256); > > > > > > Works fine as: > > print_if_Warn() if (system("nstat -a") / 256); > > print_if_Fatal() if (system("netstat -nr") / 256); >

Re: Module to pull Netstat summary information?

2004-02-28 Thread WC -Sx- Jones
R. Joseph Newton wrote: &print_if_Warn if (system("nstat -a") / 256); &print_if_Fatal if (system("netstat -nr") / 256); Works fine as: print_if_Warn() if (system("nstat -a") / 256); print_if_Fatal() if (system("netstat -nr") / 256); Yes, so long as you dont use perl -w progname Otherwise yo

Re: Module to pull Netstat summary information?

2004-02-28 Thread WC -Sx- Jones
R. Joseph Newton wrote: So what is the pressing need to eliminate parrentheses? For not only C programmers, but for people familiar with a whole range of C-based languages, parentheses make very clear the context in which an identifier is being used. I can apprediate that there are contexts in w

Re: Module to pull Netstat summary information?

2004-02-28 Thread R. Joseph Newton
WC -Sx- Jones wrote: > # just predeclare them ALL here; before they are used. > # See my comments below What I see here are not declarations, but calls. They need no extra decoration, unless you have a passion for dispensing with parentheses. I like parentheses, for my art. I think they can h

Re: Module to pull Netstat summary information?

2004-02-27 Thread WC -Sx- Jones
R. Joseph Newton wrote: WC -Sx- Jones wrote: Better would be - #!/usr/bin/perl -w # just predeclare them ALL here; before they are used. # See my comments below ... &print_if_Warn if (system("nstat -a") / 256); &print_if_Fatal if (system("netstat -nr") / 256); Hi Bill, I'm a little uncle

Re: Module to pull Netstat summary information?

2004-02-27 Thread R. Joseph Newton
WC -Sx- Jones wrote: > Better would be - > #!/usr/bin/perl -w ... > &print_if_Warn if (system("nstat -a") / 256); > > &print_if_Fatal if (system("netstat -nr") / 256); Hi Bill, I'm a little unclear here. What do you see as calling for the ampersand & in the function calls above. Most list

RE: Module to pull Netstat summary information?

2004-02-27 Thread Michael C. Davis
At 03:19 PM 2/28/04 +1100, David le Blanc wrote: > >Are you developing for Linux? A generic Linux PROC handler might >be they way you go. Want to achieve CPAN developer status? :-) OK, that's the "glory" part. Now which way to the "fortune"? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: Module to pull Netstat summary information?

2004-02-27 Thread David le Blanc
> -Original Message- > From: Michael C. Davis [mailto:[EMAIL PROTECTED] > Sent: Saturday, 28 February 2004 4:37 AM > To: [EMAIL PROTECTED] > Subject: Re: Module to pull Netstat summary information? > > Hey, don't forget the end users on windows. At last count

RE: Module to pull Netstat summary information?

2004-02-27 Thread David le Blanc
> -Original Message- > From: Wiggins d Anconia [mailto:[EMAIL PROTECTED] > Sent: Saturday, 28 February 2004 4:00 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: Module to pull Netstat summary information? > > Please bottom post > > > This w

Re: Module to pull Netstat summary information?

2004-02-27 Thread Wiggins d Anconia
> At 09:59 AM 2/27/04 -0700, Wiggins d Anconia wrote: > >It appears netstat just reads the values from /proc/net and prints them > >in a nice way, so presumably you could use standard opens on the /proc > >files and read specifically what you want rather than having netstat > >parse them for you.

Re: Module to pull Netstat summary information?

2004-02-27 Thread Michael C. Davis
At 09:59 AM 2/27/04 -0700, Wiggins d Anconia wrote: >It appears netstat just reads the values from /proc/net and prints them >in a nice way, so presumably you could use standard opens on the /proc >files and read specifically what you want rather than having netstat >parse them for you. Though thi

Re: Module to pull Netstat summary information?

2004-02-27 Thread Wiggins d Anconia
Please bottom post > This works however I was hoping perl had a module so I didn't have to run a system application. I've been playing around with modules such as scp, telnet and ftp. I'm curious if there is one for netstat. > > thanks :-) > > I am still new to working with Perl myself but

Re: Module to pull Netstat summary information?

2004-02-26 Thread Jas
I am still new to working with Perl myself but I think I know the anwer to this one... #!/bin/perl use strict; use warnings; my $cmd = system('netstat -s')or die "Could not run command: $1"; my $cmd = system('netstat -a | grep tcp')or die "Could not run command: $1"; HTH Jas [EMAIL PROTECTED] wr

Re: Module to pull Netstat summary information?

2004-02-26 Thread u235sentinel
This works however I was hoping perl had a module so I didn't have to run a system application. I've been playing around with modules such as scp, telnet and ftp. I'm curious if there is one for netstat. thanks :-) > I am still new to working with Perl myself but I think I know the anwer > to

Re: Module to pull Netstat summary information?

2004-02-26 Thread John W. Krahn
Jas wrote: > > I am still new to working with Perl myself but I think I know the anwer > to this one... > > my $cmd = system('netstat -s')or die "Could not run command: $1"; > my $cmd = system('netstat -a | grep tcp')or die "Could not run command: $1"; If netstat executed successfully then it wi

Re: Module to pull Netstat summary information?

2004-02-26 Thread WC -Sx- Jones
John W. Krahn wrote: Jas wrote: I am still new to working with Perl myself but I think I know the anwer to this one... my $cmd = system('netstat -s')or die "Could not run command: $1"; my $cmd = system('netstat -a | grep tcp')or die "Could not run command: $1"; If netstat executed successfully t