/[Sack]/trunk/bin/storableedit.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/bin/storableedit.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 36 by dpavlin, Wed Sep 23 18:52:56 2009 UTC revision 37 by dpavlin, Wed Sep 23 23:10:50 2009 UTC
# Line 42  package StorableEdit; Line 42  package StorableEdit;
42  use Storable;  use Storable;
43  use Term::ReadLine;  use Term::ReadLine;
44    
45    
46    use lib 'lib';
47    use Sack::Digest;
48    our $digest_opened = 0;
49    sub unshard {
50            my ( $o, $v ) = @_;
51            return $v unless $o->{path}->[0] =~ m{#};
52            $digest_opened ||= Sack::Digest->open(0);
53    #       warn "### ",$o->{path}->[0], " $v\n";
54            Sack::Digest->from_int($v);
55    }
56    
57  sub new {  sub new {
58          my $o=shift;          my $o=shift;
59          my $class=(ref($o) || $o);          my $class=(ref($o) || $o);
# Line 352  sub show_hash { Line 364  sub show_hash {
364          foreach my $ky (sort keys %$data) {          foreach my $ky (sort keys %$data) {
365                  my $tt=scalar($data->{$ky});                  my $tt=scalar($data->{$ky});
366                  $tt=substr($tt, 0, $textlimit).'...' if (($textlimit) && (length($tt)>$textlimit));                  $tt=substr($tt, 0, $textlimit).'...' if (($textlimit) && (length($tt)>$textlimit));
367                  print '  ', $ky, ' => ', $tt, "\n";                  print '  ', $o->unshard($ky), ' => ', $tt, "\n";
368          } continue {          } continue {
369                  $i++;                  $i++;
370          }          }

Legend:
Removed from v.36  
changed lines
  Added in v.37

  ViewVC Help
Powered by ViewVC 1.1.26