It might be better to get references to the values:
my @ref_to_column_zero = map { \($_->[0]) } @{$twod_array};
... so you can directly manipulate these values: you just need to remember that there are links in this array, so they must be dereferenced. For instance:
for (@ref_to_column_zero) { ${ $_ } *=2; }
If you prefer to use the old approach, you can do this:
for (0..$#column_zero) { $twod_array->[$_][0] = $column_zero[$_]; }
source share