in reply to Running as Another User

In addition to Expect, there's also IPC::Run, which is good for this sort of thing (co-processes).
------------ :Wq Not an editor command: Wq