my $flag=`ssh REMOTE_SERVER [ -f /tmp/somefile.log ] && echo 1`; chomp $flag; # not really needed