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


in reply to Re: Seeking a better way to do it
in thread Seeking a better way to do it

This works assuming OP also wants to return 'Enter'. This is left out of the requirements, but I'm not sure if it is an oversight or not.