X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=lib%2FMojoFacets%2FData.pm;h=4ed6d69dbf344d4a798234dd87b0f91e142b4b40;hb=5ea4e08403ced8f4c549cd039cd3b23efc354cec;hp=b5a74a67797ccef74921dac561abc9fa3ff3eab6;hpb=b8784b3b88b935a46f35011ab8461e840fdf7848;p=MojoFacets.git diff --git a/lib/MojoFacets/Data.pm b/lib/MojoFacets/Data.pm index b5a74a6..4ed6d69 100644 --- a/lib/MojoFacets/Data.pm +++ b/lib/MojoFacets/Data.pm @@ -739,20 +739,22 @@ sub items { push @$sorted_items, $row; } - my $export_path = "public/export/$path/" . join('.', @columns); - open(my $fh, '>', $export_path) || warn "ERROR: can't open $export_path: $!"; - foreach my $f ( 0 .. $#$filtered ) { - print $fh join("\t", map { - my $i = $data->{items}->[ $filtered->[$f] ]; - if ( ref $i->{$_} eq 'ARRAY' ) { - join(',', @{ $i->{$_} }); - } else { - dump $i->{$_}; - } - } @columns),"\n"; + if ( $self->param('export') ) { + my $export_path = "public/export/$path/" . join('.', @columns); + open(my $fh, '>', $export_path) || warn "ERROR: can't open $export_path: $!"; + foreach my $f ( 0 .. $#$filtered ) { + print $fh join("\t", map { + my $i = $data->{items}->[ $filtered->[$f] ]; + if ( ref $i->{$_} eq 'ARRAY' ) { + join(',', @{ $i->{$_} }); + } else { + dump $i->{$_}; + } + } @columns),"\n"; + } + close($fh); + warn "export $export_path ", -s $export_path, " bytes\n"; } - close($fh); - warn "$export_path ", -s $export_path, " bytes\n"; warn "# test_changed ",dump( $test_changed ); my $c = { map { $_ => 1 } @columns };