9 foreach my $INC ( @INC ) {
10 foreach my $file ( glob("$INC/FS/ClientAPI/*") ) {
11 $file =~ /\/(\w+)\.pm$/ or do {
12 warn "unrecognized ClientAPI file: $file";
16 #warn "using FS::ClientAPI::$mod";
17 eval "use FS::ClientAPI::$mod;";
18 die "error using FS::ClientAPI::$mod: $@" if $@;
23 sub register_handlers {
25 my %new_handlers = @_;
26 foreach my $key ( keys %new_handlers ) {
27 warn "WARNING: redefining sub $key" if exists $handler{$key};
28 #warn "registering $key";
29 $handler{$key} = $new_handlers{$key};
36 my ( $self, $name ) = ( shift, shift );
37 my $sub = $handler{$name}
38 or die "unknown FS::ClientAPI sub $name (known: ". join(" ", keys %handler );
39 #or die "unknown FS::ClientAPI sub $name";