in reply to Matching problem

What exactly is not working? You appear to have a syntax error - word2 is not prefixed with $. This worked for me:
use strict; my ($word1,$word2); while (<DATA>) { if ($_ =~ /(\d{4}i32\.exe)/) { $word1 = $1; } if ($_ =~ /(\d{4}xcab\.exe)/) { $word2 = $1; } } print "$word1\n"; print "$word2\n"; __DATA__ 4201xcab.exe 0501i32.exe

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)