Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Dynamic array names

by CiceroLove (Monk)
on Feb 10, 2001 at 03:27 UTC ( #57515=note: print w/replies, xml ) Need Help??

in reply to Dynamic array names

Thanks to everyone that helped me get aroudn the pointer to arrays and hashes of array references and all that mutha jazz. I post my result here. Thsi is my first real foray into arrays and as such I hope is received kindly. Thanks to masem for that lovely snippet just above me. I am going to need a glass fo hogfat to wash that down my mental gullet, so to speak.
#!/usr/bin/perl use SNMP_util; $nameOID = "."; @addOID = qw(. . . +4.1.2021.2.1.5 .; $IP = ""; (@tempNameArray) = &snmpwalk($IP,$nameOID); foreach $a (@tempNameArray) { ($throw, $name) = split(/:/,$a,2); push(@arrayNames, $name); } $control = 0; foreach $i (@arrayNames) { foreach $j (@addOID) { (@breakMe) = &snmpwalk($IP,$j); ($throw, $value) = split(/:/,$breakMe[$control +],2); $resultHash{$i} .= $value.","; } $control++; } foreach $key (keys %resultHash) { ($svcMax, $svcMin, $svcActual, $svcErr) = split(/,/,$resultHas +h{$key}); print "-----------------------\n",$key, " values are:\n"; print "Maximum Services: ", $svcMax, "\n"; print "Minimum Services: ", $svcMin, "\n"; print "Actual Services Running: ", $svcActual, "\n"; print "Error Message: ", $svcErr, "\n"; }

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2021-09-24 16:44 GMT
Find Nodes?
    Voting Booth?

    No recent polls found