- or download this
my(@filenames, $directory);
opendir($directory, $directory_path)
or die "opendir of $directory_path failed: $!\n";
@filenames = grep /\A\d+\.jpg\z/, readdir($directory);
closedir($directory);
- or download this
use File::Spec;
-d $subdir_path
or mkdir($subdir_path, 0777)
or die "mkdir of $subdir_path failed: $!\n";
rename($filename, File::Spec->catfile($subdir_path, $filename))
or die "rename of $filename failed: $!\n";
- or download this
use File::Spec;
for my $directory_path (@ARGV) {
...
}
}