in reply to nstat - Retrieve statistics about a newsgroup when you're using the leafnode newsserver

Ouch, that long pseudo-case statement could be a little more efficient:
foreach $key (keys %readers) { if ($key =~ /\b(\w+)\b/) { $name = $1; } else { next; } if ($name eq 'Mozilla') { # do your platform check } elsif ($name eq 'whatever') { # increment the other hash } # and so forth... }
Just do the regex once, if your data set supports it. It looks like it does.
  • Comment on RE: nstat - Retrieve statistics about a newsgroup when you're using the leafnode newsserver
  • Download Code

Replies are listed 'Best First'.
RE: RE: nstat - Retrieve statistics about a newsgroup when you're using the leafnode newsserver
by le (Friar) on Jun 09, 2000 at 10:28 UTC
    Thanks for pointing that out. You (I) don't always see the easiest way at first.