if ( /go/ && exists $files{$file}) { push @PLACE, @batch; delete $files{$file}; } if (/go/) { @batch=(); }