in reply to arrays, hoh?

UNTESTED rewrite of the first part of your code:
#!/usr/bin/perl use strict; use warnings; # $ENV{PATH} = qq(/usr/sbin:/usr/bin); ?? This makes no sense - it is +unused my %dg; while (qx|vxdg list|) { next if /name/i; $dg { +(split)[0] } = {}; } #my (@hdisks,@sizes,@nodupHdisks,@nodupLuns,@lunid,$svc,$dg,$hdisk,@fs +,$lun); # Process df -k ------------ for my $dfline ( qx|df -k| ) { $dg{ $_} {FS} = +(split $dfline)[6] if $dfline=~/$_/ for keys %df; } for my $dgname (keys %dg){ for my $vxp ( qx|vxprint -thvm -g $dgname |) { $dg{$dgname}{whatever} = value ... ....
This way, you build up the structure %df, and don't execute the same connand repeatedly.

Also , uses qx (backtick equivalent) instead of piped open of command lines.

     Theory is when you know something, but it doesn't work.
    Practice is when something works, but you don't know why it works.
    Programmers combine Theory and Practice: Nothing works and they don't know why.         -Anonymous