use strict; use warnings; use Text::Levenshtein 'distance'; my @old = ( 'abc.*f', 'hello world\d', '1234' ); my $new = 'abcd.*f'; for (@old) { print "Warning: $new looks like $_\n" if distance( $new, $_ ) < 6; }