[1100] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[D-O-H] r1067 - trunk/owl

daemon@ATHENA.MIT.EDU (nelhage@MIT.EDU)
Thu Oct 29 18:13:01 2009

Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
X-Original-To: nelhage@nelhage.com
To: dirty-owl-hackers@MIT.EDU
From: nelhage@MIT.EDU
Reply-to: dirty-owl-hackers@MIT.EDU
Date: Fri, 30 May 2008 12:41:33 -0400 (EDT)

Author: nelhage
Date: 2008-05-30 12:41:31 -0400 (Fri, 30 May 2008)
New Revision: 1067

Modified:
   trunk/owl/perlwrap.pm
Log:
Make the 'style' command assume the main:: package for unqualified
subroutine references. Reported by Jesse Vincent.


Modified: trunk/owl/perlwrap.pm
===================================================================
--- trunk/owl/perlwrap.pm	2008-05-28 17:26:36 UTC (rev 1066)
+++ trunk/owl/perlwrap.pm	2008-05-30 16:41:31 UTC (rev 1067)
@@ -1022,6 +1022,9 @@
     my $perl = shift;
     my $fn   = shift;
     {
+        # For historical reasons, assume unqualified references are
+        # in main::
+        package main;
         no strict 'refs';
         unless(*{$fn}{CODE}) {
             die("Unable to create style '$name': no perl function '$fn'\n");
@@ -1054,8 +1057,11 @@
     if($self->{useglobals}) {
         $_[0]->legacy_populate_global();
     }
-    no strict 'refs';
-    goto \&{$self->{function}};
+    {
+      package main;
+      no strict 'refs';
+      goto \&{$self->{function}};
+    }
 }
 
 


home help back first fref pref prev next nref lref last post