Index: src/modules/rlm_perl/rlm_perl.c
===================================================================
RCS file: /source/radiusd/src/modules/rlm_perl/rlm_perl.c,v
retrieving revision 1.52
diff -u -r1.52 rlm_perl.c
--- src/modules/rlm_perl/rlm_perl.c	14 May 2007 22:27:20 -0000	1.52
+++ src/modules/rlm_perl/rlm_perl.c	5 Jul 2007 21:14:55 -0000
@@ -45,6 +45,8 @@
 extern char **environ;
 #endif
 
+#define DYNAMIC_LIBPERL "libperl.so.5.8"
+
 #ifdef USE_ITHREADS
 
 /*
@@ -109,6 +111,9 @@
 #ifdef USE_ITHREADS
 	PERL_POOL	*perl_pool;
 #endif
+#ifdef DYNAMIC_LIBPERL
+	void    *libperlhandle;
+#endif
 } PERL_INST;
 /*
  *	A mapping of configuration file names to internal variables.
@@ -735,6 +740,16 @@
 		return -1;
 	}
 
+#ifdef DYNAMIC_LIBPERL
+	/* make libperl symbols visible to dynamic perl extensions like Data::Dumper
+	 * on Debian/GNU Linux */
+	inst->libperlhandle = dlopen(DYNAMIC_LIBPERL, RTLD_LAZY|RTLD_GLOBAL);
+	if (inst->libperlhandle) {
+	  radlog(L_DBG, "dlopen returned %p", inst->libperlhandle);
+	} else {
+	  radlog(L_DBG, "dlopen says: %s", dlerror());
+	}
+#endif
 
 	embed[0] = NULL;
 	if (inst->perl_flags) {
@@ -1295,6 +1310,10 @@
 	perl_free(inst->perl);
 #endif
 
+#ifdef DYNAMIC_LIBPERL
+	dlclose(inst->libperlhandle);
+#endif
+
 	free(inst);
 	return exitstatus;
 }
