#!/usr/bin/perl -w use strict; use Data::Dumper; use OLE::Storage_Lite; use Encode; use String::Escape qw( backslash ); $Data::Dumper::Useqq = 0; my $ole = OLE::Storage_Lite->new("lab.gcd"); my $oleroot = $ole->getPpsTree([1]); my %cleanoleroot; sub CleanHash { my($full, $clean) = @_; if(ref($full->{'Child'})) { $clean->{Child} = []; foreach(@{$full->{'Child'}}) { my %hash = (); push(@{$clean->{Child}}, \%hash); CleanHash($_, \%hash); } } $clean->{'Name'} = decode('UTF-16LE', $full->{'Name'}); $clean->{'DataEscaped'} = backslash($full->{'Data'}); $clean->{'Data'} = $full->{'Data'}; } CleanHash($oleroot,\%cleanoleroot); print Dumper(\%cleanoleroot);