I actually never used any perl style loops before other than foreach my $i ( ... );
and the working script I took that code indeed used foreach statement.
I got alot of recoding work to do, replacing all C style loops with a Perl style loop.
Thanks for clarification.