- # now split the call into parts if required
- @parts = ($call =~ '/') ? split('/', $call) : ($call);
-
- # remove any /0-9 /P /A /M /MM /AM suffixes etc
- if (@parts > 1) {
- $p = $parts[0];
- shift @parts if $p =~ /^(WEB|NET)$/o;
- $p = $parts[$#parts];
- pop @parts if $p =~ /^(\d+|[PABM]|AM|MM|BCN|SIX|WEB|NET|Q\w+)$/o;
- $p = $parts[$#parts];
- pop @parts if $p =~ /^(\d+|[PABM]|AM|MM|BCN|SIX|WEB|NET|Q\w+)$/o;
+ foreach $call (split /,/, $calls) {
+ # first check if the whole thing succeeds
+ my @nout = get($call);
+ if (@nout && $nout[0] eq $call) {
+ dbg("got exact prefix: $nout[0]") if isdbg('prefix');
+ push @out, @nout;
+ next;
+ }
+
+ # now split the call into parts if required
+ @parts = ($call =~ '/') ? split('/', $call) : ($call);
+
+ # remove any /0-9 /P /A /M /MM /AM suffixes etc
+ if (@parts > 1) {
+ $p = $parts[0];
+ shift @parts if $p =~ /^(WEB|NET)$/o;
+ $p = $parts[$#parts];
+ pop @parts if $p =~ /^(\d+|[JPABM]|AM|MM|BCN|JOTA|SIX|WEB|NET|Q\w+)$/o;
+ $p = $parts[$#parts];
+ pop @parts if $p =~ /^(\d+|[JPABM]|AM|MM|BCN|JOTA|SIX|WEB|NET|Q\w+)$/o;
+
+ # can we resolve them by direct lookup
+ foreach $p (@parts) {
+ @nout = get($p);
+ if (@nout && $nout[0] eq $call) {
+ dbg("got exact prefix: $nout[0]") if isdbg('prefix');
+ push @out, @nout;
+ next;
+ }
+ }
+ }