in reply to Redifined variable?

The code you have posted doesn't reproduce the warnings you've shown. diagnostics, splain
"my" variable $host masks earlier declaration in same scope at ./ftp-t +est.pl line 42 (#1) (W misc) A "my", "our" or "state" variable has been redeclared in +the current scope or statement, effectively eliminating all access to the prev +ious instance. This is almost always a typographical error. Note that + the earlier variable will still exist until the end of the scope or un +til all closure referents to it are destroyed.