in reply to Responding to terminal I/O

'.. I'm trying to write a script that will attempt to log in as su on my unix box..'
see Unix::Login - Customizable Unix login prompt and validation module, it might be what you what

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me