On 04/20/2012 05:42 AM, lina wrote:
I used to ssh Mars (servers's name) and then cd to some directory and
check some file's modification time.
Can I do it locally with perl, without ssh?

A local Perl script will need some way to read the mtime of the file on the remote host. If you get to the host via SSH, then you're going to need a Perl SSH module...


As an alternative, you can use ssh from the command line to run a Perl one-liner on a remote host (p3600) that prints the modification time of a file (.bashrc):

    $ ssh p3600 'perl -e "print(scalar localtime((stat(q(.bashrc)))[9]))"'


HTH,

David


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to