Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Thank you very much. This will help me. Can we perfom a match by first concating the 2 strings and then querying on it.
my $left = "xfafasfsdfasdfasdsfFOOBAR"; my $right = "FOOBAR4t11"; # my $concat = "xfafasfsdfasdfasdsfFOOBARFOOBAR4t11"; my $concat = $left,$right;

I should be able to hold on to FOOBAR in a back reference so that I can do further manipulation.
I need it this way because I do not know the size of boundaries which will match and I would like to match the maximum characters possible to match.
After this match the two sub strings should be concatnated. this concatnated string will have a single copy of FOOBAR in the middle. like
my $conc = "xfafasfsdfasdfasdsfFOOBAR4t11";
now this concatnated string will need to matched with one more string let us say
my $str3 = "AR4t11xysadgsfje";

Now AR4t11 will match and the above process is repeated. How efficient will this be if I have about sub strings of size about 500 each and I need to compare about 10000 such sequences with each other.

Thank you snowcrash I am using your snippet to solve my problem i.e binary search method. trying to match size between a predefined minimum required match and a maximum match, the size of the smaller among the two compared strings. I need to do this because I need a maximum possible match.

braj

Replies are listed 'Best First'.
Re: Boundry search rephrased question?
by I0 (Priest) on Apr 04, 2001 at 02:35 UTC
    #is this what you're trying to do? my $left = "xfafasfsdfasdfasdsfFOOBAR"; my $right = "FOOBAR4t11"; (my $concat = "$left,$right") =~ s/(.*),\1/$1/;