projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix prefix error
[spider.git]
/
perl
/
Prefix.pm
diff --git
a/perl/Prefix.pm
b/perl/Prefix.pm
index 01e3079c7387c46b2aa39d010c4d6dd95fea5c12..32b1e72ec0ec65c57ae4ba4218c3b163b394a8b1 100644
(file)
--- a/
perl/Prefix.pm
+++ b/
perl/Prefix.pm
@@
-173,18
+173,28
@@
sub extract
}
# which is the shortest part (first if equal)?
}
# which is the shortest part (first if equal)?
+ dbg("Parts: $call = " . join('|', @parts)) if isdbg('prefix');
$sp = $parts[0];
foreach $p (@parts) {
$sp = $parts[0];
foreach $p (@parts) {
- $sp = $p if length $
sp > length $
p;
+ $sp = $p if length $
p < length $s
p;
}
}
- # now start to resolve it from the left hand end
- for ($i = 1; $i <= length $sp; ++$i) {
+ $sp =~ s/-\d+$//; # remove any SSID
+
+# # 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));
my @wout = get(substr($sp, 0, $i));
-
las
t if @wout > 0 && $wout[0] gt $sp;
-
last if @wout == 0;
+
nex
t if @wout > 0 && $wout[0] gt $sp;
+
#
last if @wout == 0;
push @out, @wout;
push @out, @wout;
+ last if @wout;
}
}
}
}
+ if (isdbg('prefix')) {
+ my $dd = new Data::Dumper([ \@out ], [qw(@out)]);
+ dbg($dd->Dumpxs);
+ }
return @out;
}
return @out;
}