working with new base text merge routine, up to line 25
[scpubgit/stemmatology.git] / lib / Text / Tradition.pm
index 6cce95f..c2deeae 100644 (file)
@@ -72,10 +72,10 @@ sub BUILD {
        if( $format ) {
            my @parseargs;
            if( $format =~ /^(CSV|CTE)$/ ) {
-               @parseargs = ( 'base' => $init_args->{'base'},
-                              'data' => $init_args->{$format},
-                              'format' => $format );
+               $init_args->{'data'} = $init_args->{$format};
+               $init_args->{'format'} = $format;
                $format = 'BaseText';
+               @parseargs = %$init_args;
            } else {
                @parseargs = ( $init_args->{ $format } ); 
            }
@@ -92,7 +92,8 @@ sub witness {
     foreach my $wit ( @{$self->witnesses} ) {
        $requested_wit = $wit if $wit->sigil eq $sigil;
     }
-    warn "No such witness $sigil" unless $requested_wit;
+    # We depend on an undef return value for no such witness.
+    # warn "No such witness $sigil" unless $requested_wit;
     return $requested_wit;
 }
        
@@ -101,6 +102,7 @@ sub add_witness {
     my $self = shift;
     my $new_wit = Text::Tradition::Witness->new( @_ );
     push( @{$self->witnesses}, $new_wit );
+    return $new_wit;
 }
 
 # The user will usually be instantiating a Tradition object, and