in reply to RegEx needed

$ip_pattern = qr((?:(?:[01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.){3}(?:[01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5]));

This matches only IP addresses. There's one caveat: 0.0.0.0 is matched too.

Use it like this:

if ($oid =~ /^(?:\d+\.)+\d+$/ and $oid !~ /^$ip_pattern$/o) { blah blah blah }

janitored by ybiC: Balanced <code> tags around code sample, as per Monastery convention