in reply to Re: unable to store shared hash with Storable
in thread unable to store shared hash with Storable

JSON's encode() function would create a UTF8 text string out of the shared hash, so I just decoded() it back into an (unshared) HREF, and then I just stored that.

my $encoded = JSON::XS->new->utf8->encode( $HREF ); my $decoded = JSON::XS->new->utf8->decode( $encoded ); store $decoded, $filename1;
or I could just slap it all into one statement:
store(JSON::XS->new->utf8->decode( JSON::XS->new->utf8->encode( $HREF ) ), $filename1);
and all is well in the universe again!

Replies are listed 'Best First'.
Re^3: unable to store shared hash with Storable
by ikegami (Patriarch) on Aug 11, 2011 at 02:12 UTC
    Well, I was suggesting you could use JSON *instead* of Storable — they're both tools to serialise data structures — but that works too :)