my %hash ; my ($remote_mt,$local_mnt); while () { unless ( /\A#|^$/ ) { ($remote_mt,$local_mt) = +(split)[0,1] if (/nfs/i); $hash {$remote_mt} = $local_mt; } } if ( %hash ) { while ( my ($k, $v) = each(%hash) ) { print "\nKicking my dog off my leg: $k => $v\n" ; print qx(date +%x" "%X) ; } } else { print "\n", qx(date +%x" "%X) ; die "YIKES, my dog is on my leg!\n" ; } use Data::Dumper; print Dumper(\%hash);