$pull_cmd = "expect ssh.exp sid\@".$ipaddress." \"scp root\@comp2:/tmp/10mbfile /tmp/\" perlassasin27";} my $timer=0; while((@returned_lines)=` $pull_cmd`) { $timer++; print "TIME:$timer\n"; #debug message my $filesize = $bs * $count; my $timeout=((0.000012968376*$size)-1.0862736)*2; if ($timer>$timeout) { open(ERROR_LOG,">ErrorLog-$Options{device}.log"); print ERROR_LOG "THE File is taking too long to transfer than anticipated. Check Connection."; close(ERROR_LOG); print "ERROR. check log for more details.\n"; exit(1); } } my $size = $bs * $count; my $timeout=((0.000012968376*$size)-1.0862736)*2; print "this is file size:$size\nthis is timeout time in sec: $timeout\n"; #debug Message