/[Sack]/trunk/bin/sack.pl
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/bin/sack.pl

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

revision 82 by dpavlin, Sat Sep 26 12:32:30 2009 UTC revision 84 by dpavlin, Tue Sep 29 16:54:05 2009 UTC
# Line 289  sub merge_out { Line 289  sub merge_out {
289          warn "## merge out ", dump $out if $debug;          warn "## merge out ", dump $out if $debug;
290  }  }
291    
292    our $rec;
293    
294  sub run_code {  sub run_code {
295          my ( $view, $code ) = @_;          my ( $view, $code ) = @_;
296    
# Line 301  sub run_code { Line 303  sub run_code {
303          my $affected = 0;          my $affected = 0;
304          $t = time;          $t = time;
305    
306            my $coderef = eval "sub { $code }";
307            if ( $@ ) {
308                    warn "ABORT code: $@";
309                    return;
310            }
311    
312          foreach my $pos ( $offset + 1 .. $offset + $input->size ) {          foreach my $pos ( $offset + 1 .. $offset + $input->size ) {
313                  my $rec = $cache->{$pos} ||= $input->fetch_rec( $pos );                  $rec = $cache->{$pos} ||= $input->fetch_rec( $pos );
314                  if ( ! $rec ) {                  if ( ! $rec ) {
315                          print STDERR "END @ $pos";                          print STDERR "END @ $pos";
316                          last;                          last;
317                  }                  }
318    
319                  eval "$code";                  eval { $coderef->() };
320                  if ( $@ ) {                  if ( $@ ) {
321                          warn "ABORT $pos $@\n";                          warn "ABORT $pos $@\n";
322                          last;                          last;

Legend:
Removed from v.82  
changed lines
  Added in v.84

  ViewVC Help
Powered by ViewVC 1.1.26