in reply to $#array issue

while($index < $#array+1){ $last=pop(@array);

You modify your @array while iterating over it. Don't.

Replies are listed 'Best First'.
Re^2: $#array issue
by biohisham (Priest) on Jun 15, 2009 at 16:04 UTC
    Thanks to everybody who has replied to my post on $#array... I never noticed that I was modifying both $index and $#array issue, everybody else seemed to have noticed the issue...and "your mother" thumps up, I will use that trick in debugging... the issue is that I am learning Perl entirely on my own and so sometimes I missout on such things...