my $data = shift; for (my $i=0; $i<$data->count; $i++) { $data->pdata[$i]->vsomething->x = $whatever; }