in reply to Re: How to generate network topology with perl ?
in thread How to generate network topology with perl ?

I'll definitely be checking this out. A couple style nits:

Strategy in comments. Tactics in code.
Don't mention any actual numbers, operators or data types in a comment, and you're less likely to get out of sync.

use constant TIMEOUT => 5; # seconds, for traceroutes

Think higher.
If you think about the problem in strategy terms, you won't micromanage your tactics.

open(HOST, $file ) or die "Can't open `$file': $!\n"; my @hosts = <HOST>; close(HOST); chomp @hosts;

--
[ e d @ h a l l e y . c c ]

Replies are listed 'Best First'.
Re: Re: Re: How to generate network topology with perl ?
by Fletch (Bishop) on Apr 29, 2004 at 23:57 UTC

    The while loop was that way for a reason because at one time it was going to possibly deal with comments (I just never stuck the next if /^\s*#/; et al in there); other things changed (moved into Postgres) and the list-o-hosts wound up not being commented.

    Guilty as charged on the first count, though. %)