Re: Module to pull Netstat summary information?

From: R. Joseph Newton (rjnewton_at_efn.org)
Date: 02/29/04


Date: Sat, 28 Feb 2004 18:22:02 -0800
To: sx@insecurity.org

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);
> >
>
> Yes, so long as you dont use
>
> perl -w progname
>
> Otherwise you get:
>
> Useless use of a constant in void context at sxWARN line 12.
> Useless use of a constant in void context at sxWARN line 13.
>
> Cheers!
> -Bill-

I'd have to see the full code and coding context for that. Can you show the
code as run, por better yet run the whole thing at the command line, and post it
entire. You should not get those results unless \you have remove the parens
from the call.

In Perl, every method has aan implicit argument list, which may be empty. So
parens actually communicate something about the call from a logical view. The
vestigial address-of operator OTOH, is more a low-level implementation detail,
akin to goto function_nmae. I'll stick with the parens.

Joseph



Relevant Pages

  • Re: Crypt::RSA tests fail with a segfault
    ... FAILED tests 1-12 ... Useless use of a variable in void context at t/15-benchmark.t line 57. ... My perl is compile using the HP C compiler. ...
    (comp.lang.perl.modules)
  • Re: Problems with Parse::Lex
    ... #!/usr/bin/env perl ... my @token-qw( ... Useless use of a constant in void context at -e line 7. ...
    (comp.lang.perl.misc)
  • Re: list assignment
    ... use strict; ... Useless use of a constant in void context at ./try.plx line 4. ... perl places the last item in the list into the variable. ...
    (perl.beginners)
  • Re: A problem with precedence
    ... Use warnings. ... Because Perl is more often wrong about this warning than it is right. ... Useless use of multiplication in void context at -e line 1. ...
    (comp.lang.perl.misc)
  • Re: Perl style examples
    ... Semicolon seems to be missing at Perl_style_examples.pl line 192. ... Useless use of bitwise and in void context at Perl_style_examples.pl line 192. ...
    (comp.lang.perl.moderated)