]> git.vpit.fr Git - perl/modules/Sub-Op.git/blobdiff - lib/Sub/Op.pm
This is 0.02
[perl/modules/Sub-Op.git] / lib / Sub / Op.pm
index c075bbb8612aae2b8fe7502139a8ad8419116341..8b7325658143c7f5ac1763b84c11c8a5649ea813 100644 (file)
@@ -11,7 +11,7 @@ Sub::Op - Install subroutines as opcodes.
 
 =head1 VERSION
 
-Version 0.01
+Version 0.02
 
 =cut
 
@@ -20,7 +20,7 @@ our ($VERSION, @ISA);
 sub dl_load_flags { 0x01 }
 
 BEGIN {
- $VERSION = '0.01';
+ $VERSION = '0.02';
  require DynaLoader;
  push @ISA, 'DynaLoader';
  __PACKAGE__->bootstrap($VERSION);
@@ -50,11 +50,11 @@ In your XS file :
     BOOT:
     {
      sub_op_config_t c;
-     c.name  = "reftype";
-     c.len   = sizeof("reftype")-1;
-     c.pp    = scalar_util_reftype;
-     c.check = 0;
-     c.ud    = NULL;
+     c.name    = "reftype";
+     c.namelen = sizeof("reftype")-1;
+     c.pp      = scalar_util_reftype;
+     c.check   = 0;
+     c.ud      = NULL;
      sub_op_register(aTHX_ &c);
     }
 
@@ -215,7 +215,7 @@ Allowed to be static.
 
 =item *
 
-C<STRLEN len>
+C<STRLEN namelen>
 
 C<name>'s length, in bytes.
 
@@ -435,6 +435,14 @@ BEGIN { _monkeypatch() }
 
 See the F<t/Sub-Op-LexicalSub> directory that implements a complete example.
 
+=head1 CAVEATS
+
+Preexistent definitions of a sub whose name is handled by L<Sub::Op> are restored at the end of the lexical scope in which the module is used.
+But if you define a sub in the scope of action of L<Sub::Op> with a name that is currently being replaced, the new declaration will be obliterated at the scope end.
+
+Function calls without parenthesis inside an C<eval STRING> in the scope of the pragma won't be replaced.
+I know a few ways of fixing this, but I've not yet decided on which.
+
 =head1 DEPENDENCIES
 
 L<perl> 5.10.