added new DXUser with homemade data->ref and ref->data routines
[spider.git] / perl / export_user.pl
index 950b72e5386527b12daf5f7d9dad09b77e13ea27..2b21466b7ce5d1b9e95a223092c733bbdc0e70f5 100755 (executable)
@@ -24,7 +24,7 @@ $userfn = $ARGV[0] if @ARGV;
 DXUser->init($userfn);
 
 @all = DXUser::get_all_calls();
-$t = scalar time;
+$t = scalar localtime;
 print "#!/usr/bin/perl
 #
 # The exported userfile for a DXSpider System
@@ -40,15 +40,9 @@ package DXUser;
 
 for $a (@all) {
        my $ref = DXUser->get($a);
-       print "'$a' => bless ( { ";
+       my $s = $ref->encode();
        
-       my $f;
-       for $f (sort keys %{$ref}) {
-               my $val = ${$ref}{$f};
-           $val =~ s/'/\\'/og;
-               print "'$f' => '$val', ";
-       }
-       print " }, 'DXUser'),\n";
+       print "'$a' => qq{ $s },\n";
        $count++;
 }
 print ");\n