perl -E '@a=(2)x2; ch(\@a);sub ch{@{$_[0]}=(6) x scalar @{$_[0]}}; say for @a'