in reply to why doesn't this work
Invoking readline directly, instead of using the <> operator should work just fine.