Index: owl.c
===================================================================
--- owl.c	(revision 864ed359c1c6fbc341ca8d3a273cb7c2ae4e0875)
+++ owl.c	(revision b67ab6b90002b0f2ff52289b0318415bd73cace9)
@@ -589,5 +589,5 @@
   if(owl_message_is_direction_in(m)) {
     /* let perl know about it*/
-    owl_perlconfig_getmsg(m, 0, NULL);
+    owl_perlconfig_getmsg(m, NULL);
 
     /* do we need to autoreply? */
Index: perlconfig.c
===================================================================
--- perlconfig.c	(revision 9c7a701363179369d764454b0d99e559ab89ed9e)
+++ perlconfig.c	(revision b67ab6b90002b0f2ff52289b0318415bd73cace9)
@@ -411,32 +411,12 @@
 }
 
-char *owl_perlconfig_getmsg(owl_message *m, int mode, char *subname)
-{ 
-  /* if mode==1 we are doing message formatting.  The returned
-   * formatted message needs to be freed by the caller.
-   *
-   * if mode==0 we are just doing the message-has-been-received
-   * thing.
-   */
-  if (!owl_global_have_config(&g)) return(NULL);
-  
-  /* run the procedure corresponding to the mode */
-  if (mode==1) {
-    char *ret = NULL;
-    ret = owl_perlconfig_call_with_message(subname?subname
-					   :"BarnOwl::_format_msg_legacy_wrap", m);
-    if (!ret) {
-      ret = owl_sprintf("@b([Perl Message Formatting Failed!])\n");
-    } 
-    return ret;
-  } else {
-    char *ptr = NULL;
-    if (owl_perlconfig_is_function("BarnOwl::Hooks::_receive_msg")) {
-      ptr = owl_perlconfig_call_with_message(subname?subname
-				       :"BarnOwl::_receive_msg_legacy_wrap", m);
-    }
-    if (ptr) owl_free(ptr);
-    return(NULL);
-  }
+void owl_perlconfig_getmsg(owl_message *m, char *subname)
+{
+  char *ptr = NULL;
+  if (owl_perlconfig_is_function("BarnOwl::Hooks::_receive_msg")) {
+    ptr = owl_perlconfig_call_with_message(subname?subname
+                                           :"BarnOwl::_receive_msg_legacy_wrap", m);
+  }
+  if (ptr) owl_free(ptr);
 }
 
Index: perlglue.xs
===================================================================
--- perlglue.xs	(revision 864ed359c1c6fbc341ca8d3a273cb7c2ae4e0875)
+++ perlglue.xs	(revision b67ab6b90002b0f2ff52289b0318415bd73cace9)
@@ -256,10 +256,8 @@
 
 void
-_create_style(name, object)
+create_style(name, object)
      char *name
      SV  *object
      PREINIT:
-		/* This is to allow us to bootstrap the default style before the
-		command architecture has been initialized */
 		owl_style *s;
      CODE:
Index: perlwrap.pm
===================================================================
--- perlwrap.pm	(revision 864ed359c1c6fbc341ca8d3a273cb7c2ae4e0875)
+++ perlwrap.pm	(revision b67ab6b90002b0f2ff52289b0318415bd73cace9)
@@ -153,11 +153,4 @@
 }
 $configfile ||= $ENV{HOME}."/.owlconf";
-
-# populate global variable space for legacy owlconf files
-sub _format_msg_legacy_wrap {
-    my ($m) = @_;
-    $m->legacy_populate_global();
-    return &BarnOwl::format_msg($m);
-}
 
 # populate global variable space for legacy owlconf files
@@ -702,8 +695,10 @@
         if(*BarnOwl::format_msg{CODE}) {
             # if the config defines a legacy formatting function, add 'perl' as a style 
-            # BarnOwl::_create_style("perl", "BarnOwl::_format_msg_legacy_wrap",
-            #                        "User-defined perl style that calls BarnOwl::format_msg"
-            #                        . " with legacy global variable support");
-            # BarnOwl::set("-q default_style perl");
+            BarnOwl::create_style("perl", BarnOwl::Style::Legacy->new(
+                "BarnOwl::format_msg",
+                "User-defined perl style that calls BarnOwl::format_msg"
+                . " with legacy global variable support",
+                1));
+             BarnOwl::set("-q default_style perl");
         }
     }
@@ -779,5 +774,5 @@
 sub description {"Default style";}
 
-BarnOwl::_create_style("default", "BarnOwl::Style::Default");
+BarnOwl::create_style("default", "BarnOwl::Style::Default");
 
 ################################################################################
@@ -869,5 +864,5 @@
 sub description {"Compatability alias for the default style";}
 
-BarnOwl::_create_style("basic", "BarnOwl::Style::Basic");
+BarnOwl::create_style("basic", "BarnOwl::Style::Basic");
 
 package BarnOwl::Style::OneLine;
@@ -896,5 +891,5 @@
 sub description {"Formats for one-line-per-message"}
 
-BarnOwl::_create_style("oneline", "BarnOwl::Style::OneLine");
+BarnOwl::create_style("oneline", "BarnOwl::Style::OneLine");
 
 ################################################################################
@@ -996,4 +991,28 @@
 }
 
+package BarnOwl::Style::Legacy;
+
+sub new {
+    my $class = shift;
+    my $func  = shift;
+    my $desc  = shift;
+    my $useglobals = shift;
+    $useglobals = 0 unless defined($useglobals);
+    return bless {function    => $func,
+                  description => $desc,
+                  useglobals  => $useglobals}, $class;
+}
+
+sub description {shift->{description}};
+
+sub format_message {
+    my $self = shift;
+    if($self->{useglobals}) {
+        $_[0]->legacy_populate_global();
+    }
+    no strict 'refs';
+    goto \&{$self->{function}};
+}
+
 
 # switch to package main when we're done
