My hash creations are not working as I expected: %hash = ( @mir, @mir2 ); Why?
But do work at %hash = ( $mir[0], $mir2[0] ); Obviously I need the entire arrays and their associated key/value pairs, and have tried various methods unsuccessfully from Programming Perl CD such as array of hashes. The end result for my key/value pair should look like Mirror copies 1 : /dev/vg00/lvol3 Which is the printed output of the individual element assignment as %hash = ($mir[0],$mir2[0]); But cannot get %hash = (@mir,@mir2); to work. Plz help. my (%hash,@mir,@mir2) = (); my ($key2,$value2) = 0; foreach my $lv (@lvs) { push @mir => (grep /mirror/i, `lvdisplay $lv`); push @mir2 => (grep s/^LV Name\s*//, `lvdisplay $lv`); chomp (@mir,@mir2); } #%hash = (@mir,@mir2); ## This does not work the way I expect, so I tried the foreach in the next line. foreach (@mir) { foreach (@mir2) { ($key2,$value2) = [ split ]; $hash{$key2} = $value2; } } while (($key2,$value2) = each %hash) { # ($key2,$value2) = [ split ]; print "$key2\t:$value2"; } Derek Bellner Smith Unix Systems Engineer Cardinal Health Dublin, Ohio 614-757-5000 Main 614-757-8075 Direct 614-757-8120 Fax [EMAIL PROTECTED] Cardinal Health -- Working together. For life. (sm) _________________________________________________ This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. Dansk - Deutsch - Espanol - Francais - Italiano - Japanese - Nederlands - Norsk - Portuguese - Svenska: www.cardinalhealth.com/legal/email