in reply to qx//, ssh -t (pseudo-tty) and sudo

try IPC::Open3 (or 2)...