in reply to typo? variable misteriously becoming undef

I think your problem lies in the shift @la.in your code as $la[0] is taken from the from being set and $la[1] is now $la[0].. You seem to be adding things to the array and then removing them ala shift. So when you get to the end you have nothing in the array.

update: I changed it so it made more sense, as when I reread it the third time, I seemed to have been babbling.

-enlil