--- modules/modperl.cpp	2010-06-29 20:58:14.000000000 +0200
+++ modules/modperl.cpp	2010-09-04 22:58:26.000000000 +0200
@@ -21,6 +21,11 @@
 
 #include "modperl/pstring.h"
 
+#if defined(__APPLE__)
+#include <crt_externs.h>
+#define environ (*_NSGetEnviron())
+#endif
+
 // Allows perl to load .so files when needed by .pm
 // For example, it needs to load ZNC.so
 extern "C" {

