I'm using bourne for this... but escaping the single quotes like this:
gives me the same syntax errors. (sh: syntax error at line 1: `(' unexpected)
It looks as though the shell is actually complaining and, therefore, I guess I should assume that the perl one-liner format (quoting) is incorrect? In this, Ikegami, you may be on the right track.
I'd love to put this in a script on the remote machine and run it from our watch server but then I'd need tiny scripts on every server that needs to be watched. This would make things a bit too complex to maintain.
Is there no way to stat a remote file using ssh from within a perl script and capture the output?