At 1:48 PM -0600 9/21/01, Nathan Torkington wrote:
>
>How would you rewrite this to reflect "better programming practice"?
>
>     sub commify {
>         local $_  = shift;
>         1 while s/^([-+]?\d+)(\d{3})/$1,$2/;
>         return $_;
>     }

  the "1 while" construct is something I am not familiar with. I dont 
understand its purpose. my best guess is that it is almost the same 
as using the global modifier, but I dont know:

s/^([-+]?\d+)(\d{3})/$1,$2/g;

but to answer the original question, it looks fine to me
-- 

Reply via email to