in reply to Invalid Argument while opening a file.

It seems this test failed, as there's no output from it. Put an else on this and fail?
if (-f $env_file) { print "\nfile is there\n"; }

I'd be suspicious of rsh with windows backwhacks. Do you need to convert those? Did you try something like:

rsh machine echo pathname

to see what happens?

-QM
--
Quantum Mechanics: The dreams stuff is made of