in reply to subsitute s/ and match m/ failure
You're trying to strip '.log' of $model, where clearly you want to strip it of $ip.