in reply to open with a command

There's a Net::Rsh module that seems like it might do what you need, in a fairly basic way...