You need to dereference the array before iterating through it, otherwise you iterate over one element (the reference). That means you need to change $dataoptions{$columns[$i]} to @{$dataoptions{$columns[$i]}}.