#! /usr/bin/perl -w
# copycode <files>
# Starting in the current directory (from which <files> is based) copies
# <files> ten times to a succession of directories named
# the current one D with a 2 appended:  D2, D22, etc. 

chop($basedir = `pwd`); #directory relative to files
$dir = $basedir."2";
$allargs = "";
for ($i=0;defined($ARGV[$i]);$i++) {
  $allargs = $allargs." ".$ARGV[$i];
}
for ($i=1; $i<=10; $i++) {
  $cmd = "cp ".$allargs." ".$dir;
  system($cmd);
  #print "$cmd\n";
  $dir = $dir."2";  #next directory to get <files>
}
