http://www.perlmonks.org?node_id=470586


in reply to sub that sets $_

It is possible to do what you want...by returning an object. See the implementation of IO::Prompt for an example.