A
Anders Bystrup
Hi.
I'm trying to make the following work:
$index = 0;
foreach (@mac){
if (grep /$_/, $legalmacs !~ 0){
push @violators, join('',@mac[$index]," found on $switch port
@port[$index]\n"
$index++;
}
$index++;
}
The point is that i have a list ($legalmacs) that contains a list of mac
addresses permitted on our network. @mac contains mac addresses actually
found on the network (along with an acompanying @port of the port number
on which the mac was found). I need to check whether a @mac is in the
list $legalmacs - and if not add it and the port to @violators.
When i use the code above i simply get all the macs found...
I probably misunderstood something basic as usual - anyone with an idea to
make it work?
/Anders
I'm trying to make the following work:
$index = 0;
foreach (@mac){
if (grep /$_/, $legalmacs !~ 0){
push @violators, join('',@mac[$index]," found on $switch port
@port[$index]\n"
$index++;
}
$index++;
}
The point is that i have a list ($legalmacs) that contains a list of mac
addresses permitted on our network. @mac contains mac addresses actually
found on the network (along with an acompanying @port of the port number
on which the mac was found). I need to check whether a @mac is in the
list $legalmacs - and if not add it and the port to @violators.
When i use the code above i simply get all the macs found...
I probably misunderstood something basic as usual - anyone with an idea to
make it work?
/Anders