- or download this
my @list = glob("$home/*.$type");
foreach my $file (@list)
...
{
$result = `mv $file $home/$basedir/$key`;
}
- or download this
foreach my $file (glob("$home/*.$type"), glob("$home/*.\U$type"))
{
system('mv', $file, "$home/$basedir/$key") == 0 or
warn "Could not move $file: $!";
}
- or download this
system('mkdir', '-p', "$home/$basedir/$key")
unless -d "$home/$basedir/$key";