Help for this page

Select Code to Download


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