in reply to Re^4: two vars from one string.
in thread two vars from one string.
if (/.../g) doesn't make sense in theory — why would check if a string matches a pattern, then check some more? — and it's buggy in practice.
for (<...>) loads the entire file into memory. You could just as easily process the file a line at a time using while (<...>).
DATA will never produce anything after the first pass of the outer loop, since the first pass read DATA until its EOF. Place the contents of DATA into an array and iterate over the array instead.
You're evaluating qx(hostname) countless time when once would do.
|
|---|