added comments to Changes
[spider.git] / perl / export_user.pl
index 950b72e5386527b12daf5f7d9dad09b77e13ea27..3157d21aede0e738b09a9fd67163e0f0981e1583 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,13 @@ package DXUser;
 
 for $a (@all) {
        my $ref = DXUser->get($a);
-       print "'$a' => bless ( { ";
+       if (ref $ref) {
+               my $s = $ref->encode();
        
-       my $f;
-       for $f (sort keys %{$ref}) {
-               my $val = ${$ref}{$f};
-           $val =~ s/'/\\'/og;
-               print "'$f' => '$val', ";
+               print "'$a' => q{ $s },\n";
+       } else {
+               print "# $a has gorn missing\n";
        }
-       print " }, 'DXUser'),\n";
        $count++;
 }
 print ");\n