in reply to Trying to get alarm to work...

If you don't mind using ssh rather than rsh, you can try this:
system('ssh', '-o', 'ConnectTimeout 4', '-o', 'SetupTimeout 4', $host, + 'cd');