in reply to Matching strings differing by a number of periods

You can remove the periods from a copy before testing (with tr/.//d), or else construct a regex with optional periods:

my $to_match = 'xyz123abc'; $to_match = join '\.*', map {quotemeta} split //, $to_match; # $to_match is now 'x\.*y\.*z\.*1\.*2\.*3\.*a\.*b\.*c'. $to_match = qr/$to_match/; /$to_match/ && print for <>;
The quotemeta mapping is to escape any regex metacharacters which may be in $to_match. There are none in the example.

After Compline,
Zaxo