xiaoyafeng has asked for the wisdom of the Perl Monks concerning the following question:
Thanks in advance!#!/usr/bin/perl use strict; use warnings; open (FH,"<xyf.lst") or die "error!! $! \n"; my @file_lists = <FH>; my $files = \@file_lists; m_fork(5,$files,\&dbv_check); sub dbv_check { my ($file,$logfile)= @_; system ("dbv","file=$file","blocksize=8192","logfile=$logfile"); } sub m_fork { my ($max,$file_list,$dbv_command) = @_; my $count = 0; foreach my $file_name (@$file_list) { wait if $count>$max; die "error\n" unless defined(my $pid = fork()); exit $dbv_command->($file_name,$count) unless $pid; $count ++; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How debug
by kyle (Abbot) on Mar 20, 2007 at 02:29 UTC | |
by xiaoyafeng (Deacon) on Mar 20, 2007 at 03:09 UTC | |
|
Re: How debug
by jesuashok (Curate) on Mar 20, 2007 at 02:39 UTC |