for (@matches) { my (undef, $ip) = split /\s+/; ... # Your code to deal with the IP here. }