Index: Makefile.am
===================================================================
--- Makefile.am	(revision de18326f12c18fd92f275bf46bca509343b79063)
+++ Makefile.am	(revision 5aa33fd73dce2c8d6c88559e62cd1ae78ef4a36d)
@@ -11,5 +11,5 @@
 zcrypt_SOURCES = zcrypt.c filterproc.c
 
-check_PROGRAMS = tester.bin perl_tester
+check_PROGRAMS = tester.bin
 
 barnowl_bin_SOURCES = $(BASE_SRCS) \
@@ -26,11 +26,4 @@
 
 tester_bin_LDADD = libfaim/libfaim.a
-
-perl_tester_SOURCES = $(BASE_SRCS) \
-     owl.h owl_perl.h config.h \
-     $(GEN_C) $(GEN_H) \
-     perl_tester.c
-
-perl_tester_LDADD = libfaim/libfaim.a
 
 TESTS=runtests.sh
Index: rl_tester.c
===================================================================
--- perl_tester.c	(revision 737b8f16912a0ac4905cb24609e3980fc2378717)
+++ 	(revision )
@@ -1,36 +1,0 @@
-#define OWL_PERL
-#include "owl.h"
-
-owl_global g;
-
-extern XS(boot_BarnOwl);
-extern XS(boot_DynaLoader);
-/* extern XS(boot_DBI); */
-
-static void owl_perl_xs_init(pTHX)
-{
-  const char *file = __FILE__;
-  dXSUB_SYS;
-  {
-    newXS("BarnOwl::bootstrap", boot_BarnOwl, file);
-    newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
-  }
-}
-
-static PerlInterpreter *my_perl;  /***    The Perl interpreter    ***/
-
-int main(int argc, char **argv, char **env)
-{
-  /* Code from perldoc perlembed */
-  PERL_SYS_INIT3(&argc,&argv,&env);
-  my_perl = perl_alloc();
-  perl_construct(my_perl);
-  PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
-  perl_parse(my_perl, owl_perl_xs_init, argc, argv, (char **)NULL);
-  perl_run(my_perl);
-  perl_destruct(my_perl);
-  perl_free(my_perl);
-  PERL_SYS_TERM();
-  return 0;
-}
-
Index: perlconfig.c
===================================================================
--- perlconfig.c	(revision 1b1cd2cda4440db58f76fdfc5a6f5ab697a2bdf5)
+++ perlconfig.c	(revision 5aa33fd73dce2c8d6c88559e62cd1ae78ef4a36d)
@@ -12,5 +12,5 @@
 /* extern XS(boot_DBI); */
 
-static void owl_perl_xs_init(pTHX)
+void owl_perl_xs_init(pTHX) /* noproto */
 {
   const char *file = __FILE__;
@@ -363,4 +363,6 @@
   perl_construct(p);
 
+  PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
+
   owl_global_set_no_have_config(&g);
 
Index: runtests.sh
===================================================================
--- runtests.sh	(revision 81601a6a52de91076c7a753e2e0a093978647e5d)
+++ runtests.sh	(revision 5aa33fd73dce2c8d6c88559e62cd1ae78ef4a36d)
@@ -5,3 +5,3 @@
 export BARNOWL_BIN_DIR="$SRCDIR/"
 
-HARNESS_PERL=./perl_tester exec prove t/
+HARNESS_PERL=./tester exec prove t/
Index: t/mock.pl
===================================================================
--- t/mock.pl	(revision 42ad91716a0f429f02385235acffa71546e28caa)
+++ t/mock.pl	(revision 5aa33fd73dce2c8d6c88559e62cd1ae78ef4a36d)
@@ -1,25 +1,10 @@
-use File::Basename;
-use lib (dirname($0) . '/../perl/lib');
-
 package BarnOwl;
 use strict;
 use warnings;
-use Carp;
 
-sub get_data_dir {"."}
-sub get_config_dir {"."}
-sub create_style {}
-
-sub debug {
+no warnings 'redefine';
+sub debug($) {
     warn "[DEBUG] ", shift, "\n" if $ENV{TEST_VERBOSE};
 }
 
-sub BarnOwl::Internal::new_command {}
-sub BarnOwl::Internal::new_variable_bool {}
-sub BarnOwl::Internal::new_variable_int {}
-sub BarnOwl::Internal::new_variable_string {}
-sub BarnOwl::Editwin::save_excursion(&) {}
-
-use BarnOwl;
-
 1;
Index: tester.c
===================================================================
--- tester.c	(revision c2673ab15d7fc087cb84a7587a978d90930cdda2)
+++ tester.c	(revision 5aa33fd73dce2c8d6c88559e62cd1ae78ef4a36d)
@@ -1,5 +1,12 @@
+#define OWL_PERL
+#define WINDOW FAKE_WINDOW
 #include "owl.h"
+#undef WINDOW
+
 #include <unistd.h>
 #include <stdlib.h>
+
+#undef instr
+#include <curses.h>
 
 owl_global g;
@@ -14,4 +21,6 @@
 int owl_obarray_regtest(void);
 int owl_editwin_regtest(void);
+
+extern void owl_perl_xs_init(pTHX);
 
 int main(int argc, char **argv, char **env)
@@ -35,7 +44,42 @@
   owl_global_complete_setup(&g);
 
-  status = owl_regtest();
+  if (argc > 1) {
+    char *code;
+    FILE *f;
+
+    if (strcmp(argv[1], "-le") == 0 && argc > 2) {
+      /*
+       * 'prove' runs its harness perl with '-le CODE' to get some
+       * information out.
+       */
+      moreswitches("l");
+      code = argv[2];
+    } else {
+      f = fopen(argv[1], "r");
+      if (!f) {
+        perror(argv[1]);
+        status = 1;
+        goto out;
+      }
+      code = owl_slurp(f);
+      sv_setpv(get_sv("0", false), argv[1]);
+    }
+
+    ENTER;
+    SAVETMPS;
+
+    eval_pv(code, true);
+
+    status = 0;
+
+    FREETMPS;
+    LEAVE;
+  } else {
+    status = owl_regtest();
+  }
 
  out:
+  perl_destruct(owl_global_get_perlinterp(&g));
+  perl_free(owl_global_get_perlinterp(&g));
   /* probably not necessary, but tear down the screen */
   endwin();
