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
22 sub load_clientapi_modules {
25 foreach my $INC ( @INC ) {
26 my $glob = "$INC/FS/ClientAPI/*.pm";
27 warn "FS::ClientAPI: searching $glob" if $DEBUG;
28 foreach my $file ( glob($glob) ) {
29 $file =~ /\/(\w+)\.pm$/ or do {
30 warn "unrecognized ClientAPI file: $file";
34 warn "using FS::ClientAPI::$mod" if $DEBUG;
35 eval "use FS::ClientAPI::$mod;";
36 die "error using FS::ClientAPI::$mod: $@" if $@;
42 =item dispatch [ name ]
47 my ( $self, $name ) = ( shift, shift );
49 my $sub = "FS::ClientAPI::$name";
50 warn "$me dispatch: calling $sub with args @_\n" if $DEBUG;