5 use vars qw( @EXPORT_OK %handler $domain $DEBUG $me );
7 @EXPORT_OK = qw( load_clientapi_modules );
10 $me = '[FS::ClientAPI]';
18 =item load_clientapi_modules
24 sub load_clientapi_modules {
27 foreach my $INC ( @INC ) {
28 my $glob = "$INC/FS/ClientAPI/*.pm";
29 warn "FS::ClientAPI: searching $glob" if $DEBUG;
30 foreach my $file ( glob($glob) ) {
31 $file =~ /\/(\w+)\.pm$/ or do {
32 warn "unrecognized ClientAPI file: $file";
36 warn "using FS::ClientAPI::$mod" if $DEBUG;
37 eval "use FS::ClientAPI::$mod;";
38 die "error using FS::ClientAPI::$mod: $@" if $@;
44 =item dispatch [ name ]
49 my ( $self, $name ) = ( shift, shift );
51 my $sub = "FS::ClientAPI::$name";
52 warn "$me dispatch: calling $sub with args @_\n" if $DEBUG;