# of elements per array 14 array1 53 array2 416 array3 416 array4 52 array5 I have tried these ways unsuccessfully my %hash = (); @hash{ @array1,@array2,etc } = @list; AND for (@nodupLuns) { $hash{@dgarray}{@fs}{@nodupHdisks}{@sizes} = { 'lunid' => $_ }; } __CODE__ #!/usr/bin/perl use strict; use warnings; $ENV{PATH} = qq(/usr/sbin:/usr/bin); my @dgarray; open (DG, "vxdg list |") or die "vxdg did not open $!"; while () { next if /name/i; push @dgarray, +(split)[0]; } close (DG); my (@hdisks,@sizes,@nodupHdisks,@nodupLuns,@lunid,$svc,$dg,$hdisk,@fs,$lun); for $dg (@dgarray) { open (DF, "df -k |") or die "df did not open $!"; while () { if ( /$dg/ ) { push @fs, +(split)[6]; } } close (DF); open (VXP, "vxprint -thvm -g $dg |") or die "vxprint did not open $!"; while () { if ( /device_tag/ ) { my @tmp = (split /device_tag=/); for $svc (@tmp) { open (VXD, "vxdisk list $svc |") or die "vxdisk list failed $!"; while () { if ( /state=\w+/ ) { push @hdisks, (split /state=enabled/); } } } } } close (VXD); } my %counts; @nodupHdisks = grep { $_ =~ /hdisk\d+/ and ++$counts{$_} < 2 } @hdisks; @sizes = map `bootinfo -s $_`, @nodupHdisks; for $lun (@nodupHdisks) { open (LUNID, "lscfg -vl $lun |") or die "lscfg failed $!"; while () { if (/serial/i) { push @lunid, substr($_,-33); } } } %counts = (); @nodupLuns = grep { $_ =~ /\w+/ and ++$counts{$_} < 2 } @lunid;