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
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);
>
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
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
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
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
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
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
> -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
> -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
> 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.
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
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
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
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
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
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
17 matches
Mail list logo