remove unnecessary circular use of FS::ClientAPI, doesn't work with 5.8.[56] + perl??
[freeside.git] / FS / FS / ClientAPI.pm
index 7cbbdbf..1109ede 100644 (file)
@@ -1,19 +1,23 @@
 package FS::ClientAPI;
 
 use strict;
-use vars qw(%handler $domain);
+use vars qw(%handler $domain $DEBUG);
+
+$DEBUG = 1;
 
 %handler = ();
 
 #find modules
 foreach my $INC ( @INC ) {
-  foreach my $file ( glob("$INC/FS/ClientAPI/*.pm") ) {
+  my $glob = "$INC/FS/ClientAPI/*.pm";
+  warn "FS::ClientAPI: searching $glob" if $DEBUG;
+  foreach my $file ( glob($glob) ) {
     $file =~ /\/(\w+)\.pm$/ or do {
       warn "unrecognized ClientAPI file: $file";
       next
     };
     my $mod = $1;
-    #warn "using FS::ClientAPI::$mod";
+    warn "using FS::ClientAPI::$mod" if $DEBUG;
     eval "use FS::ClientAPI::$mod;";
     die "error using FS::ClientAPI::$mod: $@" if $@;
   }