Not built-in, but from CPAN, check Term::ReadKey and Term::ReadLine
In reply to Re: scan keyboard by larsen in thread scan keyboard by Anonymous Monk