The problem is that, after the first iteration of the while loop, the next time the condition is tested is the final line of the while loop's block. This is seems very weird and counter-intuitive to me. I can't see an easy way around this right now.
Jeff japhy Pinyan,
P.L., P.M., P.O.D, X.S.:
Perl,
regex,
and perlhacker How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart