my @lines = `list cm device all-properties`; my @matches = grep { /configsync-ip/ } @lines; chomp @matches; # Remove trailing newlines