I'm having an issue getting a value assigned to a variable after a regex match, for an iP address. I'm sure I'm doing something that's clearly wrong, and obvious to most, but I'm new to Perl and I've been working on this for 2 days now. The assignment is just not happening right.

In the match and substitution line, it appears that the regex is matching just fine, but when I try to send the matched data to a variable ($ipaddress in this case) it always fails. Is there a better way to do this?