in reply to trying HoH

You did not show us what you want the contents of your HoH to be. Is is something like this?
$VAR1 = { 'SAN_VC0_42' => { 'hdisk368' => 'state=enabled', 'hdisk303' => 'state=enabled', 'hdisk636' => 'state=enabled', 'hdisk35' => 'state=enabled', 'hdisk904' => 'state=enabled', 'hdisk571' => 'state=enabled', 'hdisk100' => 'state=enabled', 'hdisk839' => 'state=enabled' } };

If so, then this more verbose code will accomplish that:

my @vxdisk_lines = qx(vxdisk list $lun); chomp @vxdisk_lines; my @hdisks = grep {/hdisk\d+/} @vxdisk_lines; my %h; for (@hdisks) { my ($k, $v) = split; $h{$k} = $v; } $luns_to_hdisk{$lun} = \%h;

Replies are listed 'Best First'.
Re^2: trying HoH
by mikejones (Scribe) on Nov 11, 2008 at 02:27 UTC
    You all definitely helped! Thx agn. I want my end result to look like b/c all I need is one hdisk string b/c they are all different logical paths to the same LUN. I don't need the 'state=enabled' part and tried using (split)[0] but failed. Once I have this I will then integrate another system command (or a 2nd hash value) on the value hdisk368 for example to get its serial number.
    END_RESULT $VAR1 = { 'SAN_VC0_42' => { 'hdisk368' => 'state=enabled', } };
    I was playing with, but was side-tracked.
    print ((<DATA>)[-1]); __DATA__ Device: SAN_VC0_42 devicetag: SAN_VC0_42 type: auto info: format=none flags: online ready private autoconfig invalid pubpaths: block=/dev/vx/dmp/SAN_VC0_42 char=/dev/vx/rdmp/SAN_VC0_42 Multipathing information: numpaths: 8 hdisk35 state=enabled hdisk100 state=enabled hdisk303 state=enabled hdisk368 state=enabled hdisk571 state=enabled hdisk636 state=enabled hdisk839 state=enabled hdisk904 state=enabled