I was just reading last night in Learning Perl about the special variables, $', $& and $`. The $& hold the contents of the m// string while the $` and $' contain the text before the m// and after it. I'm not sure which one does which, but is sounds like with these three variables, you would have the whole line.
I believe these are notoriously inefficient and should be avoided. Allegedly using some of these causes them to be calculated for the whole program, slowing down every regex whether you need the variables or not. Sorry, I forgot the source where that info came from.
The code posted above is functional for the task (it can be refactored a small bit), he just needs to load up @data differently.