heidi,
ikegami++
You have not clearly given what you are going to achieve. The following works as per your logic.
use strict;
use warnings;
my ($first, $last) = $find =~ /([A-Z])[A-Z]*([A-Z])/; #extract first a
+nd last character
if ($string =~ /$first/ && $string =~ /$last/) #check both character p
+resent in string
{
my $out;
for ($first..$last) #increment inbetween characters
{
$out = $out.$_ ;
}
print "'$find' string found" if ($string =~ /$out/); # if found pr
+int the string
}
or Simply
my $string = "ABCDEFGHIJKLMNOPCDEFQRST";
my $find="CDEF";
print "'$find' string found" if ($string =~ /$find/);