On Dec 12, 2003, at 4:20 PM, Kenton Brede wrote:
[..]I've cobbled some code together that will allow me to parse a file snarfing 4 lines which consist of server name and Daily output of bandwith usage.
I'm not exactly a programming wonder and trying to learn.[..]
Kent,
As has been noted, james has covered most of the salient GP coding features - so I am left once again to play 'thinking outside of the box'. First off thanks for the nicely formatted data and 'real world' issue to play with.
My extension to your basic problem is based on the classical "multi-homed" host, one with more than one NIC card in it. Given that some of our readers are not sure how to work with 'hashes' I thought I would take the time to marry the two concerns.
I have posted the demonstration code at: <http://www.wetware.com/drieux/pbl/Sys/Admin/Net/interface_read.plx>
So My first step was to come up with data model, which presumed no more of the 'incoming' information than that
* <hostname>
told me that the following records would be about that host - whether that meant a single data set about One Or More Nic's, or the case that we would have information about a single nic for that hostname and would find more nic information later on for that same hostname...
Since I am a fan of perl's subs, since they are a leading cause of Perl Modules, I thought I would start with one sub, decide that I wanted to go off in a different direction. Comment out the first call to that sub, and replace it with a 'cooler' sub.... This should also help illustrate a way of 'evolving' code forward.
Have fun.
ciao drieux
---
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>