print "William's picture download tool.";
print " Accessing camera...\n";
$num_pics = `photopc count`;
$num_pics = substr($num_pics,0,length($num_pics)-1);
print "There are ".$num_pics." pictures in the camera.\n\n";
print "Enter filename prefix: "; 
$pre = <STDIN>;
$pre = substr($pre,0,length($pre)-1);
print "Writing date file to this directory.";
system "date > date";

for ($i = 1; $i <= $num_pics; $i++) {
   $z = "";
   if ($i < 100) {
      $z = "0";
   } 
   if($i < 10) {
      $z = "00";
   }

   $s="photopc image ".$i." ".$pre.$z.$i.".jpg\n";
   print $s;
   system $s;
}

#sub myname;
#$me = myname $0             or die "can't get myname";
