in reply to program hangs on user input
Works fine for me. Maybe you've accidentally changed the input record sepaprator $/ ?