X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FPrefix.pm;h=15b6752dbcbc2bfef0810e4d408a730273253be1;hb=6b6eda0362049fd67809f2789e523708a1a8cb13;hp=01e3079c7387c46b2aa39d010c4d6dd95fea5c12;hpb=7ccae7dc99f806c3a0b128a0cf26cf8e489048fb;p=spider.git diff --git a/perl/Prefix.pm b/perl/Prefix.pm index 01e3079c..15b6752d 100644 --- a/perl/Prefix.pm +++ b/perl/Prefix.pm @@ -177,12 +177,15 @@ sub extract foreach $p (@parts) { $sp = $p if length $sp > length $p; } - # now start to resolve it from the left hand end - for ($i = 1; $i <= length $sp; ++$i) { +# # now start to resolve it from the left hand end +# for ($i = 1; $i <= length $sp; ++$i) { + # now start to resolve it from the right hand end + for ($i = length $sp; $i >= 1; --$i) { my @wout = get(substr($sp, 0, $i)); last if @wout > 0 && $wout[0] gt $sp; - last if @wout == 0; +# last if @wout == 0; push @out, @wout; + last if @wout; } } return @out;