for ($i = 0; $i<=$#array; ++$i) { undef $array[$i]; } #### for ($i = 0; $i<=$#array; ++$i) { $array[$i] = undef; }