{ my @restore; print "$_->[0] $_->[1] $_->[2]\n" foreach map { $restore[unpack('N', substr($_, -4))] } sort map { my ($type, $item, $index) = @$_; push(@restore, $_); my ($int, $fract) = split(/\./, $index); my $flagValue = flagValue($tagTypes{$item}[2]); $flagValue = -$flagValue if $type eq 'off'; pack('NNCN', int($index), $index =~ /\.(\d+)/, $flagValue & 0xFF ^ 0x80, $#restore, ) } @tagIndexes; } #### join '', pack('N', int($index)), pack('N', $index =~ /\.(\d+)/), sprintf('%02d', $flagValue), pack('N', $#restore)