Now --run works
Peter Rabbitson [Wed, 10 Nov 2010 04:34:24 +0000 (05:34 +0100)]
benchmark/class_factory

index 8f60bf2..a168a6b 100644 (file)
@@ -120,8 +120,8 @@ sub _add_moosey_has {
         unless $opts->{unique};
 
       if ($opts->{run}) {
-        $perl .= 'package main;';
-        $perl .= "our \$foo = $class->$_; $class->$_(1); our \$foo = $class->$_;"
+        $perl .= "\$::obj = $class->new;";
+        $perl .= "\$::foo = \$::obj->$_; \$::obj->$_(1); \$::foo = \$::obj->$_;"
           for @attr_names;
       }
     }