Very valuable advice that the OP would better take into account. But since nobody has mentioned it yet, and he wrote so many lines of code for this simple task, it is also worth pointing out that he may well save himself all this trouble and use Sys::Hostname instead, which I've always found to be quite reliable.
In reply to Re^2: not getting hostname correctly on UNIX
by blazar
in thread not getting hostname correctly on UNIX
by slavam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |