Hi first posting here.
I'm using perl to connect via port to a remote box which then runs a command which appears in a array from the call box. I'm parsing the output, but seem to be having a problem with syntax. I wonder if someone could help.
Output in array
HOSTNAME xxxxx
CPU 1.2
MEM 53M
ARB-MDATA-1
ARB-MDATA-2
MTL-MDATA-1
Dup
ARB-MDATA-1
ARB-MDATA-2
MTL-MDATA-1
NYC-MDATA-5
from my script I can get everything working apart from reading "Dup" as the delimiter.
any pointers would be appreciated.
I'm using perl to connect via port to a remote box which then runs a command which appears in a array from the call box. I'm parsing the output, but seem to be having a problem with syntax. I wonder if someone could help.
Output in array
HOSTNAME xxxxx
CPU 1.2
MEM 53M
ARB-MDATA-1
ARB-MDATA-2
MTL-MDATA-1
Dup
ARB-MDATA-1
ARB-MDATA-2
MTL-MDATA-1
NYC-MDATA-5
from my script I can get everything working apart from reading "Dup" as the delimiter.
Code:
foreach $any (@highway) {
if ($any =~ "CPU") {
$cpu = $any ;
} elsif ($any =~ "MEM") {
$mem = $any ;
} elsif ($any =~ "HOSTNAME") {
$rvr_host = $any ;
} else {
until ($any eq $dup) {
push (@config, $any) ;
}
push (@live, $any) ;
}
}
Comment