stuart: devel/kolab/Kolab Util.pm,1.3,1.4

cvs at intevation.de cvs at intevation.de
Wed May 12 11:20:08 CEST 2004


Author: stuart

Update of /kolabrepository/devel/kolab/Kolab
In directory doto:/tmp/cvs-serv9148

Modified Files:
	Util.pm 
Log Message:
Fixed a bug in writeArray(), cleaned up quoting


Index: Util.pm
===================================================================
RCS file: /kolabrepository/devel/kolab/Kolab/Util.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Util.pm	12 May 2004 08:46:04 -0000	1.3
+++ Util.pm	12 May 2004 09:20:06 -0000	1.4
@@ -55,7 +55,7 @@
 our $VERSION = sprintf('%d.%02d', q$Revision$ =~ /(\d+)\.(\d+)/);
 
 # What delimits the template meta data
-sub KOLAB_META_END() { return "__END_KOLAB_META__"; }
+sub KOLAB_META_END() { return '__END_KOLAB_META__'; }
 
 sub trim
 {
@@ -75,13 +75,13 @@
     return %hash if !$file;
 
     my $fd;
-    return %hash if !($fd = IO::File->new($file, "r"));
+    return %hash if !($fd = IO::File->new($file, 'r'));
 
     my $key;
     while (<$fd>) {
         if (/^([^:#]+):+([^#]*)/) {
             $key = trim($1);
-            next if $key eq "";
+            next if $key eq '';
             $hash{$key} = trim($2);
         }
     }
@@ -98,13 +98,13 @@
     return @array if !$file;
 
     my $fd;
-    return @array if !($fd = IO::File->new($file, "r"));
+    return @array if !($fd = IO::File->new($file, 'r'));
 
     my $value;
     while (<$fd>) {
         if (/^([^#]+)/) {
             $value = trim($1);
-            next if $value eq "";
+            next if $value eq '';
             push @array, $value;
         }
     }
@@ -129,7 +129,7 @@
         }
         if (/^([^:#]+):+([^#]*)/) {
             $key = trim($1);
-            next if $key eq "";
+            next if $key eq '';
             $hash{$key} = trim($2);
         }
     }
@@ -164,7 +164,7 @@
     }
 
     my $fd;
-    return if !($fd = IO::File->new($file, "w"));
+    return if !($fd = IO::File->new($file, 'w'));
 
     foreach my $key (sort keys %hash) {
         print $fd "$key : $hash{$key}\n";
@@ -181,7 +181,7 @@
     }
 
     my $fd;
-    return if !($fd = IO::File->new($file, "r"));
+    return if !($fd = IO::File->new($file, 'w'));
 
     foreach my $item (sort @array) {
         print $fd "$item\n";





More information about the commits mailing list