in reply to gathering of some elements of a list

The first thing you could do is add the strictures:
use warnings; use strict;
This will issue the following useful complaint, notifying you that $file was not assigned a value:
Global symbol "$file" requires explicit package name at script line 17 +.
Secondly, your input data does not contain the string "REGULATION ALERTS". When I run your script, I get nothing printed to the output because this string was never found.