my @dllarray = map { chomp; [ split /,/ ] } @exeDllLines; # iterate over the collected data: for ( @dllarray ) { my( $exe, @dlls ) = @$_; print "$exe uses the following DLLs:\n"; print "$\t$_\n" for @dlls; }