Acme-CPANModules-DumpingDataForDebugging

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

        sequences like 1,2,3,4,5,6 to 1..6, compacting repeating characters
        in string like "ccccccccccccccccccccc" to ("c" x 21), and so on.

        It tries harder to produce Perl code that generates the original
        data structure, particularly with circular references. But with
        interlinked references like trees, Data::Dumper might be more
        helpful in showing you which references get mentioned where. For
        example this data:

         $tree = {children=>[{children=>[{}]}, {children=>[]}]};
         $tree->{children}[0]{parent}=$tree;
         $tree->{children}[1]{parent}=$tree;
         $tree->{children}[0]{children}[0]{parent} = $tree->{children}[0];

        Data::Dump will produce:

         do {
            my $a = {
              children => [
               { children => [{ parent => 'fix' }], parent => 'fix' },
               { children => [], parent => 'fix' },
             ],
           };
           $a->{children}[0]{children}[0]{parent} = $a->{children}[0];
           $a->{children}[0]{parent} = $a;
           $a->{children}[1]{parent} = $a;
           $a;
         }

        while Data::Dumper will produce:

         $VAR1 = {
                   'children' => [
                                   {
                                     'children' => [
                                                     {
                                                       'parent' => $VAR1->{'children'}[0]
                                                     }
                                                   ],
                                     'parent' => $VAR1
                                   },
                                   {
                                     'parent' => $VAR1,
                                     'children' => []
                                   }
                                 ]
                 };

    Data::Dump::Color
        Author: PERLANCAR <https://metacpan.org/author/PERLANCAR>

        A modification to Data::Dump which adds color (and color theme)
        support, as well as other visual aids like depth and array

lib/Acme/CPANModules/DumpingDataForDebugging.pm  view on Meta::CPAN

alignment of "=>" when dumping hashes, compacting sequences like 1,2,3,4,5,6 to
1..6, compacting repeating characters in string like "ccccccccccccccccccccc" to
("c" x 21), and so on.

It tries harder to produce Perl code that generates the original data structure,
particularly with circular references. But with interlinked references like
trees, Data::Dumper might be more helpful in showing you which references get
mentioned where. For example this data:

    $tree = {children=>[{children=>[{}]}, {children=>[]}]};
    $tree->{children}[0]{parent}=$tree;
    $tree->{children}[1]{parent}=$tree;
    $tree->{children}[0]{children}[0]{parent} = $tree->{children}[0];

Data::Dump will produce:

    do {
       my $a = {
         children => [
          { children => [{ parent => 'fix' }], parent => 'fix' },
          { children => [], parent => 'fix' },
        ],
      };
      $a->{children}[0]{children}[0]{parent} = $a->{children}[0];
      $a->{children}[0]{parent} = $a;
      $a->{children}[1]{parent} = $a;
      $a;
    }

while Data::Dumper will produce:

    $VAR1 = {
              'children' => [
                              {
                                'children' => [
                                                {
                                                  'parent' => $VAR1->{'children'}[0]
                                                }
                                              ],
                                'parent' => $VAR1
                              },
                              {
                                'parent' => $VAR1,
                                'children' => []
                              }
                            ]
            };

_
        },

        {
            module=>'Data::Dump::Color',

lib/Acme/CPANModules/DumpingDataForDebugging.pm  view on Meta::CPAN

alignment of "=>" when dumping hashes, compacting sequences like 1,2,3,4,5,6 to
1..6, compacting repeating characters in string like "ccccccccccccccccccccc" to
("c" x 21), and so on.

It tries harder to produce Perl code that generates the original data structure,
particularly with circular references. But with interlinked references like
trees, Data::Dumper might be more helpful in showing you which references get
mentioned where. For example this data:

 $tree = {children=>[{children=>[{}]}, {children=>[]}]};
 $tree->{children}[0]{parent}=$tree;
 $tree->{children}[1]{parent}=$tree;
 $tree->{children}[0]{children}[0]{parent} = $tree->{children}[0];

Data::Dump will produce:

 do {
    my $a = {
      children => [
       { children => [{ parent => 'fix' }], parent => 'fix' },
       { children => [], parent => 'fix' },
     ],
   };
   $a->{children}[0]{children}[0]{parent} = $a->{children}[0];
   $a->{children}[0]{parent} = $a;
   $a->{children}[1]{parent} = $a;
   $a;
 }

while Data::Dumper will produce:

 $VAR1 = {
           'children' => [
                           {
                             'children' => [
                                             {
                                               'parent' => $VAR1->{'children'}[0]
                                             }
                                           ],
                             'parent' => $VAR1
                           },
                           {
                             'parent' => $VAR1,
                             'children' => []
                           }
                         ]
         };


=item L<Data::Dump::Color>

Author: L<PERLANCAR|https://metacpan.org/author/PERLANCAR>



( run in 0.571 second using v1.01-cache-2.11-cpan-a5abf4f5562 )