my @patterns = ( "(.*?)", # ID "(.*?)", # Time Stamp "(.*?)", # IP Address "(.*?)", # Title "(.*?)", # Reporting Entity "(.*?)", # Reporting Entity Contact "
(.*?)
", # Reporting Entity Address "(.*?)", # Reporting Entity Email ); my @xml_files = <*xml>; for my $file (@xml_files) { for my $pattern (@patterns) { ... if ($line =~ $pat) { ... } } #### my @regexps = ( qr{(.*?)}, # ID qr{(.*?)}, # Time Stamp qr{(.*?)}, # IP Address qr{(.*?)}, # Title qr{(.*?)}, # Reporting Entity qr{(.*?)}, # Reporting Entity Contact qr{
(.*?)
}, # Reporting Entity Address qr{(.*?)}, # Reporting Entity Email ); my @xml_files = <*xml>; for my $file (@xml_files) { for my $regexp (@regexps) { ... if ($line =~ $regexp) { ... } }