On Sun, Nov 29, 2009 at 5:11 AM, H.Merijn Brand <h.m.brand@xs4all.nl> wrote: > If '$s = undef' is clearly not doing what might be expected, is there > any chance in breaking code when making '$s = undef' to do the same as > 'undef $s' ? > No, I don't see how it could. > How easy would it be to `optimize' that in perl itself? > You mean remove the optimisation to prevent unnecessary calls to malloc. The answer might depend on exactly what you want. Do you wish to free the scalar's buffer 1) When the result of a call to undef is assigned to it? 2) When &PL_sv_undef is assigned to it? 3) When an undefined value is assigned to it? 4) When an undefined value is assigned to it and when it is cleared (e.g. when it goes out of scope). I'm not sure it's wise to remove this optimisation for the rare occurrence of accidentally using undef($var) instead of $var = undef in the rare occurrence that undef($var) is needed. ELBThread Next