in reply to What's wrong with my code? [from a beginner]

It works ok for me (except for the extra ">" char on the close line). I made a multipath.tr file consisting of
one two three
Of course, this doesn't look like what the program wants to process, so my output is:
in while...1 in while...1 in while...1 0
but you can see that it is processing the loop. If your multipath.tr file is empty, the loop would never execute. Is that possibly what's going on?

Caution: Contents may have been coded under pressure.