This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add padcv to Opcode.pm
[perl5.git] / ext / Opcode / Opcode.pm
index 2404dca..ae1c409 100644 (file)
@@ -6,11 +6,11 @@ use strict;
 
 our($VERSION, @ISA, @EXPORT_OK);
 
-$VERSION = "1.09";
+$VERSION = "1.24";
 
 use Carp;
 use Exporter ();
-use XSLoader ();
+use XSLoader;
 
 BEGIN {
     @ISA = qw(Exporter);
@@ -28,7 +28,7 @@ sub opset_to_hex ($);
 sub opdump (;$);
 use subs @EXPORT_OK;
 
-XSLoader::load 'Opcode', $VERSION;
+XSLoader::load();
 
 _init_optags();
 
@@ -65,7 +65,7 @@ sub _init_optags {
 
        # Split into lines, keep only indented lines
        my @lines = grep { m/^\s/    } split(/\n/);
-       foreach (@lines) { s/--.*//  } # delete comments
+       foreach (@lines) { s/(?:\t|--).*//  } # delete comments
        my @ops   = map  { split ' ' } @lines; # get op words
 
        foreach(@ops) {
@@ -288,8 +288,8 @@ invert_opset function.
 
 =head1 TO DO (maybe)
 
-    $bool = opset_eq($opset1, $opset2) true if opsets are logically eqiv
-
+    $bool = opset_eq($opset1, $opset2) true if opsets are logically
+                                       equivalent
     $yes = opset_can($opset, @ops)     true if $opset has all @ops set
 
     @diff = opset_diff($opset1, $opset2) => ('foo', '!bar', ...)
@@ -308,13 +308,14 @@ invert_opset function.
 
     rv2sv sassign
 
-    rv2av aassign aelem aelemfast aslice av2arylen
+    rv2av aassign aelem aelemfast aelemfast_lex aslice av2arylen
 
-    rv2hv helem hslice each values keys exists delete
+    rv2hv helem hslice each values keys exists delete aeach akeys
+    avalues reach rvalues rkeys
 
-    preinc i_preinc predec i_predec postinc i_postinc postdec i_postdec
-    int hex oct abs pow multiply i_multiply divide i_divide
-    modulo i_modulo add i_add subtract i_subtract
+    preinc i_preinc predec i_predec postinc i_postinc
+    postdec i_postdec int hex oct abs pow multiply i_multiply
+    divide i_divide modulo i_modulo add i_add subtract i_subtract
 
     left_shift right_shift bit_and bit_xor bit_or negate i_negate
     not complement
@@ -324,7 +325,8 @@ invert_opset function.
 
     substr vec stringify study pos length index rindex ord chr
 
-    ucfirst lcfirst uc lc quotemeta trans chop schop chomp schomp
+    ucfirst lcfirst uc lc fc quotemeta trans transr chop schop
+    chomp schomp
 
     match split qr
 
@@ -332,13 +334,15 @@ invert_opset function.
 
     cond_expr flip flop andassign orassign dorassign and or dor xor
 
-    warn die lineseq nextstate scope enter leave setstate
+    warn die lineseq nextstate scope enter leave
 
-    rv2cv anoncode prototype
+    rv2cv anoncode prototype coreargs
 
-    entersub leavesub leavesublv return method method_named -- XXX loops via recursion?
+    entersub leavesub leavesublv return method method_named
+     -- XXX loops via recursion?
 
-    leaveeval -- needed for Safe to operate, is safe without entereval
+    leaveeval -- needed for Safe to operate, is safe
+                without entereval
 
 =item :base_mem
 
@@ -393,11 +397,14 @@ These are a hotchpotch of opcodes still waiting to be considered
 
     gvsv gv gelem
 
-    padsv padav padhv padany
+    padsv padav padhv padcv padany
+
+    once
 
     rv2gv refgen srefgen ref
 
-    bless -- could be used to change ownership of objects (reblessing)
+    bless -- could be used to change ownership of objects
+            (reblessing)
 
     pushre regcmaybe regcreset regcomp subst substcont
 
@@ -411,7 +418,8 @@ These are a hotchpotch of opcodes still waiting to be considered
     sselect select
     pipe_op sockpair
 
-    getppid getpgrp setpgrp getpriority setpriority localtime gmtime
+    getppid getpgrp setpgrp getpriority setpriority
+    localtime gmtime
 
     entertry leavetry -- can be used to 'hide' fatal errors
 
@@ -439,7 +447,7 @@ beyond the scope of the compartment.
 
 These ops are related to multi-threading.
 
-    lock threadsv
+    lock
 
 =item :default
 
@@ -457,9 +465,10 @@ then you should not rely on the definition of this, or indeed any other, optag!
 
     stat lstat readlink
 
-    ftatime ftblk ftchr ftctime ftdir fteexec fteowned fteread
-    ftewrite ftfile ftis ftlink ftmtime ftpipe ftrexec ftrowned
-    ftrread ftsgid ftsize ftsock ftsuid fttty ftzero ftrwrite ftsvtx
+    ftatime ftblk ftchr ftctime ftdir fteexec fteowned
+    fteread ftewrite ftfile ftis ftlink ftmtime ftpipe
+    ftrexec ftrowned ftrread ftsgid ftsize ftsock ftsuid
+    fttty ftzero ftrwrite ftsvtx
 
     fttext ftbinary
 
@@ -503,7 +512,8 @@ information about your system but not be able to change it.
 
     utime chmod chown
 
-    fcntl -- not strictly filesys related, but possibly as dangerous?
+    fcntl -- not strictly filesys related, but possibly as
+            dangerous?
 
 =item :subprocess
 
@@ -534,6 +544,14 @@ SystemV Interprocess Communications:
 
     shmctl shmget shmread shmwrite
 
+=item :load
+
+This tag holds opcodes related to loading modules and getting information
+about calling environment and args.
+
+    require dofile 
+    caller runcv
+
 =item :still_to_be_decided
 
     chdir
@@ -547,10 +565,9 @@ SystemV Interprocess Communications:
     tied -- can be used to access object implementing a tie
     pack unpack -- can be used to create/use memory pointers
 
-    entereval -- can be used to hide code from initial compile
-    require dofile 
+    hintseval -- constant op holding eval hints
 
-    caller -- get info about calling environment and args
+    entereval -- can be used to hide code from initial compile
 
     reset
 
@@ -563,14 +580,13 @@ a tag name but need to be tagged for completeness and documentation.
 
     syscall dump chroot
 
-
 =back
 
 =head1 SEE ALSO
 
-ops(3) -- perl pragma interface to Opcode module.
+L<ops> -- perl pragma interface to Opcode module.
 
-Safe(3) -- Opcode and namespace limited execution compartments
+L<Safe> -- Opcode and namespace limited execution compartments
 
 =head1 AUTHORS