in reply to Re^2: Can anyone tell me what is going on with my code?(Regex match variables)
in thread Can anyone tell me what is going on with my code?(Regex match variables)
I find it's good practice to "capture" your capture variables immediately after a match even when you know for sure you will never be doing any further regex matching within that scope:
Just make this same, silly mistake as many times as I have and you'll never do otherwise!if ($macs[1] =~ /(\S{17})\|(\S{17})/) { my ($mac1, $mac2) = ($1, $2); ... $mac1 =~ s/.../etc/g; $mac2 =~ s/as/needed/g; ... do_something_with($mac1, $mac2); ... }
Give a man a fish: <%-{-{-{-<
|
|---|