Perhaps a minor point, but why are you capturing "port=" and "unit=" in your regexes
if ($line =~/(port=([0-9]+))/)
?
Couldn't it just as easily be
if ($line =~/port=([0-9]+)/){
$port= $1;
};
-----------------
s''limp';@p=split '!','n!h!p!';s,m,s,;$s=y;$c=slice @p1;so brutally;d;$n=reverse;$c=$s**$#p;print(''.$c^chop($n))while($c/=$#p)>=1;