Browse Source

Generalized field and value dividers

Alois Mahdal 12 years ago
parent
commit
bd0032fa01
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      lib/htsheet.pm

+ 6
- 2
lib/htsheet.pm View File

@@ -82,10 +82,14 @@ sub parse_message {
82 82
     my ($self, $message) = @_;
83 83
     my $data;
84 84
 
85
+    #TODO: Make them global
86
+    my $DIV_FIELD =";";
87
+    my $DIV_VALUE ="=";
88
+    
85 89
     # split to fields
86
-    my @fields  = split ";", $message;
90
+    my @fields  = split $DIV_FIELD, $message;
87 91
     %$data      = map {
88
-        my @fld = split "=", $_;
92
+        my @fld = split $DIV_VALUE, $_;
89 93
         ( 2 == scalar @fld ? @fld : (dummy => 'non-parseable') )
90 94
     } @fields;
91 95