in reply to Line number in a file

If you're splitting $_ several times before you get to matching the bit you want, the y/\n//c or matching $` for \n methods aren't going to work. I'd suggest prepending the line number (assuming you haven't changed $\ ;) ) when reading the file:
while (<FILE>) { s/^/[$.]/; $file .= $_; }
then do:
if(/(^\[(\d+)\](\S+)\s+(\d+)/m) { $mylist{$2} = $3; $linenumber = $1; }
Well, that's probably what I'd do (or something like it, anyway - I'd have to see the data to decide)