Thanks it is working..it was due to the reason that the script which i gave was running from another machine through remsh like "remsh machine2 -l admin /tmp/ssh.pl"
so it was not able to find path environment variable. i just made it as "remsh machine2 -l admin /tmp/.env; /tmp/ssh.pl" it worked. thank you again