in reply to Uninitalised Values - What does it mean?

Inside your foreach loop, you're assigning a list of variables from @_. But if this code is your entire program, it looks like there is nothing in @_. Did you mean @ARGV? Or did you mean something like split ' ', $record?

Since there was nothing in @_ when you assigned several variables to its contents, all those variables are still uninitialized. So when you try to perform a match on $record, you get a warning, as well as when you try to print $beginning_annotation (you did use warnings and strict, which is definitely good :-)

Another thing I noticed: did you mean to have double dollar-signs on $$beginning_annotation and $$ending_annotation?

-- Mike

--
just,my${.02}