in reply to File test on remote machine and mkpath

Not a Perl solution... but I would just use ssh to issue a mkdir on the remote host (or mkdir -p if you need to create intermediate directories, too)

ssh remotehost mkdir targetdirectory

(the path is interpreted relative to your remote home/login directory, unless you specify an absolute one)