my $ar_data = []; #Opening, reading, and extracting column content of each concord.n.txt file foreach my $output_concord_file (@output_concord_files){ #Note : for the concord file, no processing implied -> stored by default in $output_concord_file open (my $fh, '<:utf8', "$output_concord_file") || die "Couldn't open $output_concord_file : $!"; my $hr_output = {}; $hr_output->{concord_file} = $output_concord_file; while (<$fh>){ if ($_ =~ /=\[=(.*)=\]=/){ $hr_output->{url} = $1; } if ($_ =~ /=\[\+(.*)\+\]=/){ $hr_output->{sys_time} = $1; } if ($_ =~ /=E-(.*)=event/){ push(@{$hr_output->{events}}, $1); } } push(@{$ar_data}, $hr_output); close ($fh); }