+ $u{$call} = $self->encode();
+}
+
+#
+# create a string from a user reference
+#
+sub encode
+{
+ my $self = shift;
+ my $out;
+ my $f;
+
+ $out = "bless( { ";
+ for $f (sort keys %$self) {
+ my $val = $$self{$f};
+ if (ref $val) { # it's an array (we think)
+ $out .= "'$f'=>[ ";
+ foreach (@$val) {
+ my $s = $_;
+ $out .= "'$s',";
+ }
+ $out .= " ],";
+ } else {
+ $val =~ s/'/\\'/og;
+ $val =~ s/\@/\\@/og;
+ $out .= "'$f'=>q{$val},";
+ }
+ }
+ $out .= " }, 'DXUser')";
+ return $out;
+}
+
+#
+# create a hash from a string
+#
+sub decode
+{
+ my $s = shift;
+ my $ref;
+ $s = '$ref = ' . $s;
+ eval $s;
+ confess $@ if $@;
+ return $ref;