Next | Program Repair Shop | 25 |
40 sub CopyFiles { 41 @CopyList = @FileList1; 42 foreach $CopyList (@CopyList) { 43 next if ($CopyList =~ /^\./); 44 next if !($CopyList =~ (/[0-9]/)); 45 next if !($CopyList =~ (/txt/)); 46 $x1 = $InputDIR1.$CopyList; 47 $x2 = $InputDIR1.$NextOut."/".$CopyList; 48 $Tmp = `cp $x1 $x2`; 49 print $x1,"\-\>",$x2,"\n"; 50 } (The other half is an identical conjoined twin...)
The new calling convention is:
CopyFiles($dir, @files);
This becomes:
sub CopyFiles { my $dir = shift; foreach my $file (@_) { next if ($file =~ /^\./); next if !($file =~ (/[0-9]/)); next if !($file =~ (/txt/)); $x1 = $dir.$file; $x2 = $dir.$NextOut."/".$file; $Tmp = `cp $x1 $x2`; print $x1,"\-\>",$x2,"\n"; } }
19 lines become 10
Next | Copyright © 2002 M. J. Dominus |