Hey there Tye,
obviously this is a very contrived exapmle, and not something that I would necessarily do, however i'm trying to get to the bottom of a perl CORBA memory problem (in COPE) that may be casued by something similar to the above example. I didn't post my CORBA code as it only muddies the water and is too large.
Using the while loop as you have suggested still increases by 4 bytes (in both cases).
Thanks for the feedback on Perl 5.6.0 - an upgrade may be an option.
I don't follow your 'settling in' argument. Why is memory not freed for a string 'foo' assignment, but is freed for a number asignment ?
Cheers
Mike