If the above line is read from a file and then split at the space,
then the
two parts are fed into the regexrename subroutine, something like this:
regexrename($part[0], $part[1]);
sub regexrename
{
my($basedir, $expr) = @_;
print "$basedir $expr\n";
opendir(DIR, $basedir);
my(@entries) = grep(!/^\.\.?$/, readdir(DIR));
closedir(DIR);
foreach $entry ( @entries )
{
chomp($entry);
$entry =~ $expr;
print "$entry\n";
}
}
then $part[0] would become $basename and $part[1] would become $expr, wouldn't it?
$basename == /home/user/images
$expr == s#^(.*)\.jpg$#$1\.JPG#g
Gordon E.