- or download this
checkdir('/usr/tmp', sub { -w $_ });
checkdir('/usr/tmp', sub { -r $_ });
checkdir('/usr/tmp', sub { -r $_ and -w $_ });
- or download this
# now it's:
checkdir('/usr/tmp', sub { -r $_ and -w _ });
checkdir('/usr/tmp', sub { !/\.\./ });
- or download this
use List::MoreUtils qw/none/;
use File::Spec;
...
checkdir('/usr/tmp', sub {
none { $_ eq '..' } File::Spec->splitdir($_)
});
- or download this
sub checkDir {
my ($path, $perm) = @_;
...
}
LOG ("Using $path as output directory...", 2);
}