in reply to Storing regex values in an array and processing the array

Hi diamondsandperls,
Just some thoughts:
With this: (From your OP),

my @patterns = ( qr/Record contentId\=\"\d+\"/ );
You are creating an array of just one element. Which of course would be a better if you just use a scalar variable, like so:
my $patterns = qr/Record contentId\=\"\d+\"/;
and then use the modified code print {$final_fh} /$pattern/, "\n"; by choroba.

Secondly, in your while loop, you are not using the data in the variable $_ at all, which are been read from your filehanle.
And ofcourse, you still have to "match" the pattern as showed by the previous answer.
Hope this helps.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me