/[webpac2]/trunk/lib/WebPAC/Output/Sorted.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Output/Sorted.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 923 by dpavlin, Tue Oct 30 22:46:51 2007 UTC revision 924 by dpavlin, Wed Oct 31 00:26:45 2007 UTC
# Line 14  __PACKAGE__->mk_accessors(qw( Line 14  __PACKAGE__->mk_accessors(qw(
14  use Sort::External;  use Sort::External;
15  use File::Path;  use File::Path;
16  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
17    use WebPAC::Common qw/force_array/;
18    
19  =head1 NAME  =head1 NAME
20    
# Line 84  sub add { Line 85  sub add {
85    
86          my $hash = $self->ds_to_hash( $ds, 'sorted' ) || return;          my $hash = $self->ds_to_hash( $ds, 'sorted' ) || return;
87    
88          warn "add( $id, ",dump($ds)," ) => ", dump( $hash );          $log->debug("add( $id, ", sub { dump($ds) }," ) => ", sub { dump( $hash ) });
89    
90          foreach my $f ( keys %$hash ) {          foreach my $f ( keys %$hash ) {
91    
# Line 110  sub add { Line 111  sub add {
111    
112                  my @v;                  my @v;
113    
                 if ( ref( $hash->{$f} ) eq 'ARRAY' ) {  
                         @v = @{ $hash->{$f} };  
                 } else {  
                         @v =    $hash->{$f}  ;  
                 }  
   
114                  # we want LF in output file :-)                  # we want LF in output file :-)
115                  @v = map { "$_\n" } @v;                  @v = map { "$_\n" } force_array( $hash->{$f} );
116    
117                  $self->{sortex}->{$f}->feed( @v );                  $self->{sortex}->{$f}->feed( @v );
118    

Legend:
Removed from v.923  
changed lines
  Added in v.924

  ViewVC Help
Powered by ViewVC 1.1.26