agentorange has asked for the wisdom of the Perl Monks concerning the following question:
I'll say straight up I struggle with hashes and this is proving especially so with this challenge.
My _DATA_ is shown below - it's the output from a system command and the columns are space seperated. Pseudo hash structure shown below as to how I believe I need the output stored in order for me to make sense of the data in my code. Which is to be able to read the status for each subsystem/daemon and also sort all daemons by their status.
But I cannot get me head around how to construct the required hash from my _DATA_ can anyone assist please?
$VAR1 = { 'inted' => { 'Group' => 'tcpip', 'PID' => '2424886', 'Status' => 'active' } 'xntpd' => { 'Group' => 'tcpip', 'PID' => '3473550', 'Status' => 'active' } 'rwhod' => { 'Group' => 'tcpip', 'PID' => '', 'Status' => 'inoperative' } }; _DATA_ Subsystem Group PID Status inetd tcpip 2424886 active xntpd tcpip 3473550 active rwhod tcpip inoperative snmpd tcpip inoperative aixmibd tcpip inoperative hostmibd tcpip inoperative snmpmibd tcpip inoperative
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Hash creation problem
by BrowserUk (Patriarch) on Feb 19, 2014 at 11:21 UTC | |
Re: Hash creation problem
by hippo (Bishop) on Feb 19, 2014 at 11:22 UTC | |
Re: Hash creation problem
by kevbot (Vicar) on Feb 19, 2014 at 16:09 UTC | |
by BrowserUk (Patriarch) on Feb 19, 2014 at 16:20 UTC | |
by kevbot (Vicar) on Feb 19, 2014 at 16:28 UTC | |
by agentorange (Sexton) on Feb 20, 2014 at 11:11 UTC | |
Re: Hash creation problem
by sundialsvc4 (Abbot) on Feb 19, 2014 at 14:00 UTC | |
by agentorange (Sexton) on Feb 19, 2014 at 15:51 UTC |
Back to
Seekers of Perl Wisdom