[root@devel3 Storable.patch]# cat /usr/bin/bdiff.pl #!/usr/bin/perl use Algorithm::Diff qw(traverse_sequences); my ( $f1, $f2 ) = @ARGV; open $fh1, $f1 or die $!; open $fh2, $f2 or die $!; local $/; my $seq1 = [split //, <$fh1>]; my $seq2 = [split //, <$fh2>]; my (@match,@d1, @d2) = ((),(),()); traverse_sequences( $seq1, $seq2, { MATCH => sub { push @match, $seq1->[$_[0]] }, DISCARD_A => sub { push @d1, printable2($_[0])." : - ".printable($seq1->[$_[0]]) }, DISCARD_B => sub { push @d2, printable2($_[1])." : + ".printable($seq2->[$_[1]]) }, }); sub printable { sprintf "%s 0x%02X", ord($_[0])>32?$_[0]:'.',ord $_[0] } sub printable2 { sprintf "%08d 0x%08X", $_[0],$_[0] } print join "\n", @d1,@d2,"\n"; [root@devel3 Storable.patch]# bdiff.pl store.original store.patch 00004096 0x00001000 : - s 0x73 00004097 0x00001001 : - s 0x73 00004098 0x00001002 : - i 0x69 00004099 0x00001003 : - o 0x6F 00004100 0x00001004 : - n 0x6E 00004101 0x00001005 : - . 0x06 00004102 0x00001006 : - õ 0xF5 00004944 0x00001350 : + . 0x05 [root@devel3 Storable.patch]# #### 00000FD8: 72 73 74 07 00 00 00 73 65 73 73 69 6F 6E 06 F5 00 00latest......count.....fi 00000FF0: 65 73 73 69 6F 6E 5F 63 6F 75 6E 74 0A 01 4C 04 00 00rst....session.........s 00001008: 03 0E 00 00 00 04 02 00 00 00 00 14 00 00 00 61 63 74ession_count..L....type. 00001338: 05 05 00 00 00 6C 61 62 65 6C 0A 0B 78 78 78 78 78 78XX
XXXXXXXX XXXXXXXXX 00001350: 00 00 00 69 64 0A 03 4E 46 4C 0B 00 00 00 6C 65 61 67.....label..xxxxxxxxxxx. 00001368: 72 0A 1B 66 6F 6F 74 62 61 6C 6C 3A 78 78 78 78 78 78...id..NFL....league_abb ##
## [root@devel3 Storable.patch]# cat test.pl #!/usr/bin/perl use Storable qw(retrieve); $Storable::DEBUGME = 0; my $data = retrieve('store.patch'); use Data::Dumper; print Dumper $data; [root@devel3 Storable.patch]# ./test.pl $VAR1 = bless( { '_contractual' => bless( { '_VERSION' => 1, 'prefs' => { 'team/NHL' => bless( { 'category' => 'team/NHL', 'favorite' => {}, 'preferred' => {}, 'hated' => {} }, 'Preference' ), 'player/NBA' => bless( { 'category' => 'player/NBA' }, 'Preference' ), 'team/NCAAB' => bless( { 'category' => 'team/NCAAB' }, 'Preference' ), 'team/NCAAF' => bless( { 'category' => 'team/NCAAF' }, 'Preference' ), 'player/TEN' => bless( { 'category' => 'player/TEN' }, 'Preference' ), 'player/NCAAB' => bless( { 'category' => 'player/NCAAB' }, 'Preference' ), 'team/NBA' => bless( { 'category' => 'team/NBA' }, 'Preference' ), 'messages' => { 'last_post' => 1088213270, 'latest' => [ 'fantasybaseball|Fantasy Baseball Message Board|0000000000', 'fantasybaseball|Fantasy Baseball Message Board|0000000000', 'fantasybaseball|Fantasy Baseball Message Board|0000000000', 'fantasybaseball|Fantasy Baseball Message Board|0000000000', 'fantasybaseball|Fantasy Baseball Message Board|0000000000', 'fantasybaseball|Fantasy Baseball Message Board|0000000000', 'fantasybaseball|Fantasy Baseball Message Board|0000000000', 'fantasybaseball|Fantasy Baseball Message Board|0000000000', 'fantasybaseball|Fantasy Baseball Message Board|0000000000', 'fantasybaseball|Fantasy Baseball Message Board|0000000000' ] }, 'player/AUTO' => bless( { 'category' => 'player/AUTO' }, 'Preference' ), 'player/NCAAF' => bless( { 'category' => 'player/NCAAF' }, 'Preference' ), 'team/AUTO' => bless( { 'category' => 'team/AUTO' }, 'Preference' ), 'component' => {}, 'team/TEN' => bless( { 'category' => 'team/TEN' }, 'Preference' ), 'team/AUTORACING' => bless( { 'category' => 'team/AUTORACING' }, 'Preference' ), 'player/PGA' => bless( { 'category' => 'player/PGA' }, 'Preference' ), 'player/MLB' => bless( { 'category' => 'player/MLB', 'preferred' => {}, 'favorite' => {}, 'basis' => 'explicit', 'hated' => {}, 'fantasy' => { '00000' => 'explicit', '0000' => 'explicit', '000000' => 'explicit' } }, 'Preference' ), 'player/NFL' => bless( { 'category' => 'player/NFL', 'basis' => 'explicit', 'fantasy' => { '000' => 'explicit', '0000' => 'explicit', '00000' => 'explicit', '000000' => 'explicit' } }, 'Preference' ), 'player/NHL' => bless( { 'category' => 'player/NHL' }, 'Preference' ), 'ui' => bless( {}, 'UiPreference' ), 'team/PGA' => bless( { 'category' => 'team/PGA' }, 'Preference' ), 'player/mayhem' => bless( { 'category' => 'player/mayhem' }, 'Preference' ), 'team/OLY' => bless( { 'category' => 'team/OLY' }, 'Preference' ), 'team/GOLF' => bless( { 'category' => 'team/GOLF' }, 'Preference' ), 'team/MLB' => bless( { 'category' => 'team/MLB', 'preferred' => {}, 'favorite' => {}, 'hated' => {} }, 'Preference' ), 'team/TENNIS' => bless( { 'category' => 'team/TENNIS' }, 'Preference' ), 'team/NFL' => bless( { 'category' => 'team/NFL', 'favorite' => { 'NONE' => 'explicit' }, 'basis' => 'explicit' }, 'Preference' ) } }, 'ContractualData' ), '_hash_bucket' => 645, '_sequence' => '00', 'prefs' => { 'ui' => {} }, '_version' => 7, '_timestamp' => 1089225294, 'registration' => bless( { 'country' => 'USA', 'modifieddate' => 'XX/XX/XXXX', 'mi_id' => '0000000', 'sportsclub_id' => '-0000000000000000000', 'firstname' => 'XXXX', 'phone' => 'XXXXXXXXXX', 'state' => 'MD', 'lastname' => 'XXXXXXXX', 'address1' => 'XXXX XXXXXXXXX XXXXXXXX XXXX', 'address2' => '', 'birthdate' => 'XX/XX/XXXX', 'city' => 'XXXXXXXX XXXX', 'gender' => '', 'timezone' => 'EST', 'occ_code' => '', 'zip' => '00000-0000', 'rewards' => '0', 'email' => 'xxxxxxxxx@xxxxxxxxx.xxx', 'products' => { '00' => { 'status' => 1, 'prod_id' => '00' }, '000' => { 'status' => 1, 'prod_id' => '000' }, '0000' => { 'status' => 1, 'prod_id' => '0000' } } }, 'RegistrationInfo' ), 'id' => 'xxxxxxxxxxx', 'session_count' => 245, 'session' => { 'latest' => 1095301660, 'first' => undef, 'count' => 3 }, 'type' => 'L', 'fantasy' => { 'active_roster_mayhem' => [], 'teams_set' => '0000000000', 'active_team_type_MLB' => '_set', 'active_roster_MLB' => [ '000000', '00000', '00000', '000000', '00000', '000000', '0000', '000000', '000000', '0000', '00000', '000000', '000000', '0000', '0000', '0000', '000000', '0000', '000000', '0000', '000000', '0000', '0000', '000000', '00000', '000000', '00000', '000000', '0000', '0000', '0000', '00000', '0000' ], 'active_team_type_NFL' => '_set', 'active_roster_NFL' => [ '0000', '0000', '0000', '0000', '0000', '000000', '000', '0000', '0000', '000000', '000000', '000000', '000000', '000000', '000000', '0000', '00000', '000', '0000' ], 'active_roster_date_MLB' => '00000000', 'active_roster_date_NFL' => '00000000', 'teams' => [ { 'args' => 'pid=xxxxxxxxxxx', 'base' => 'http://xxxxxxxxxxxxxxxxxx.football.sportsline.com/', 'id' => 'xxxxxxxxxxx', 'label' => 'XXXXXXX XXXXX XXX
XXXXXXXX XXXXXXXXX', 'key' => 'football:xxxxxxxxxxxxxxxxxx', 'league_abbr' => 'NFL', 'logo' => 'http://xxxxxxxxxxxxxxxxxx.football.sportsline.com/ownerlogo?size=00x00' }, { 'args' => 'pid=xxxxxxxxxxx', 'base' => 'http://xxxxx.baseball.sportsline.com/', 'id' => 'xxxxxxxxxxx', 'label' => 'XXXXXXX XXXXX
XXX XXXXXXX XXXXXX', 'key' => 'baseball:xxxxx', 'league_abbr' => 'MLB', 'logo' => 'http://xxxxx.baseball.sportsline.com/ownerlogo?size=00x00' }, { 'args' => 'pid=xxxxxxxxxxx', 'base' => 'http://xxxxxxxxxxxxxxxx.2.mayhem.sportsline.com/', 'id' => 'xxxxxxxxxxx', 'label' => 'XXXX XXXXXXXX
CBS SportsLine.com Round by Round Challenge', 'key' => 'mayhem:xxxxxxxxxxxxxxxx.2', 'league_abbr' => 'mayhem', 'logo' => 'http://xxxxxxxxxxxxxxxx.2.mayhem.sportsline.com/ownerlogo?size=00x00' }, { 'args' => 'pid=xxxxxxxxxxx', 'base' => 'http://xxxxxxxxxxxxxxxxxxxxx.2.mayhem.sportsline.com/', 'id' => 'xxxxxxxxxxx', 'label' => 'XXXX XXXXXXXX
CBS SportsLine.com Perfect Bracket Challenge', 'key' => 'mayhem:xxxxxxxxxxxxxxxxxxxxx.2', 'league_abbr' => 'mayhem', 'logo' => 'http://xxxxxxxxxxxxxxxxxxxxx.2.mayhem.sportsline.com/ownerlogo?size=00x00' } ], 'active_roster_date_mayhem' => '00000000', 'active_team_MLB' => 'baseball:xxxxx', 'active_team_NFL' => 'football:xxxxxxxxxxxxxxxxxx', 'active_team_type_mayhem' => '_set', 'active_team_mayhem' => 'mayhem:xxxxxxxxxxxxxxxx.2' } }, 'Profile' ); [root@devel3 Storable.patch]#