Devel::OptreeDiff - Produces diffs of optrees
use Devel::OptreeDiff 'fmt_optree_diff'; use Data::Dumper 'Dumper'; print map "$_\n", fmt_optree_diff( sub { print @_ or die $! }, sub { print @_ } ) ); - /leavesub/lineseq/nextstate*print + /leavesub/lineseq/nextstate*null + .op_flags = 4 + .op_private = 1 + .op_targ = 0 + /leavesub/lineseq/nextstate*null/or + .op_flags = 4 + .op_other = 0 + .op_private = 1 + .op_targ = 0 + /leavesub/lineseq/nextstate*null/or/print - /leavesub/lineseq/nextstate*print/pushmark + /leavesub/lineseq/nextstate*null/or/print/pushmark - /leavesub/lineseq/nextstate*print/pushmark*rv2av + /leavesub/lineseq/nextstate*null/or/print/pushmark*rv2av - /leavesub/lineseq/nextstate*print/pushmark*rv2av/gv + /leavesub/lineseq/nextstate*null/or/print/pushmark*rv2av/gv + /leavesub/lineseq/nextstate*null/or/print/pushmark*rv2av/gv.op_flags = 2 + .op_private = 0 + .op_targ = 0 + /leavesub/lineseq/nextstate*null/or/print*die + .op_flags = 6 + .op_private = 1 + .op_targ = 2 + /leavesub/lineseq/nextstate*null/or/print*die/pushmark + .op_flags = 2 + .op_private = 0 + .op_targ = 0 + /leavesub/lineseq/nextstate*null/or/print*die/pushmark*rv2sv + .op_flags = 6 + .op_private = 1 + .op_targ = 15 + /leavesub/lineseq/nextstate*null/or/print*die/pushmark*rv2sv/gvsv + .GV = main::!
Runs Algorithm::Diff against two functions to make writing macros easier.
This is like optree_diff except that it returns a list of nicely formatted text descriptions of the changes to the optree.
A wrapped call to Algorithm::Diff::diff(). fmt_optree_diff uses this as input.
Algorithm::Diff::sdiff( ... )
Algorithm::Diff::traverse_sequences( ... )
Algorithm::Diff::traverse_balanced( ... )
This module is still under development. While the code works mostly correctly, the test 3-and-or.t expresses a wish that redundant information not be included in the output. This module will change in small ways until I can get the output looking proper.
Joshua b. Jore <jjore@cpan.org>
B::Keywords supplies seven arrays of keywords: @Scalars, @Arrays, @Hashes, @Filehandles, @Symbols, @Functions and @Barewords. The @Symbols array includes the contents of each of @Scalars, @Arrays, @Hashes and @Filehandles. Similarly, @Barewords adds a few non-function keywords (like __DATA__, NULL) to the @Functions array.
All additions and modifications are welcome.
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install Devel::OptreeDiff, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Devel::OptreeDiff
CPAN shell
perl -MCPAN -e shell install Devel::OptreeDiff
For more information on module installation, please visit the detailed CPAN module installation guide.