#!/usr/bin/perl
#
#

$debug = 1;


@list = glob("makeim.*.png");
foreach $img (@list) {
  $cmd = "convert -crop 600x60+7+25 $img foo.png";
  $ret = exec_cmd($cmd);
  $cmd = "mv foo.png $img";
  $ret = exec_cmd($cmd);
}




exit 0;






##############################################################################
# PROCEDURE: exec_cmd
#
# DESCRIPTION: Execute the given shell command line.  If the $debug flag
#              is set, we print to stdout the command line, and
#              also print out the result string.
#
# RETURNS:
#              the result of the command
#
#
sub exec_cmd {

  my($cmd, $ret);

  $cmd = $_[0];

  if ($debug > 0) {
    printf "cmd is ..$cmd.. \n";
  }
  $ret = `$cmd`;
  if ($debug > 0) {
    printf "ret is ..$ret.. \n";
  }

  return($ret);
}


