Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: (Getopt, $_, nonport interfaces)

by ybiC (Prior)
on Jul 24, 2001 at 06:01 UTC ( #99212=note: print w/ replies, xml ) Need Help??

in reply to

    Hi fingers,
First off - good job for using Net::Snmp!   I used UCD SNMP for a similar script because of the included additional utilities, but in hindsight wish I'd done like you.

A couple of trivial suggestions come to mind:

  • Getopt::Long might simplify processing of command-line arguments.
  • If you're going to use $hostname instead of $_ in
    foreach(@hostname){ undef @unique; $hostname=$_;
    it could be a tiny bit cleaner as
    foreach $hostname(@hostname){ undef @unique;
  • I don't know how well the particular syntax would transfer to your code, but "(code) mind your snmPs & Qs" uses a hash to count non-port interfaces, then subtracts them from final port status report.   As you note, it reaaally improves accuracy of generated reports.
BTW, thanks for the compliment in your pod.   I "appreciate poorly written code" because I'm so well practiced at *writing* it! 8^D
    striving toward Perl Adept
    (it's pronounced "why-bick")

Comment on Re: (Getopt, $_, nonport interfaces)
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://99212]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2015-02-01 14:16 GMT
Find Nodes?
    Voting Booth?

    On my keyboard, Caps lock is:

    Results (2 votes), past polls