make this a regex: 
```
if ($lsoutput !~ m/^$loc\s*:\s+data\s*$/) {
}