Help for this page

Select Code to Download


  1. or download this
    foreach (@ARGV) {
        usagedie() if (!-f || !-d);
    }
    
  2. or download this
    usagedie() if grep not( -f or -d ), @ARGV;
    
  3. or download this
    find(\&fileop, $opts{'directory'}) unless @ARGV;
    find(\&fileop, @ARGV) if @ARGV;
    
  4. or download this
    find( \&fileop, @ARGV ? @ARGV : $opt_directory );
    
  5. or download this
    sub fileop {
        #set the right permissions based on if a file or a directory
    ...
        chmod oct($opts{'dirmode'}), $_ if -d && $opts{'dirmode'};
        print $File::Find::name . "\n" if $opts{'verbose'} && (-f || -d);
    }
    
  6. or download this
    sub fileop {
        if( -f and $opt_filemode ) {
    ...
        }
        print $File::Find::name, "\n" if $opt_verbose;
    }
    
  7. or download this
    sub check_perm {
        my ( $mode, $perm ) = @_;
    ...
    
    $opt_filemode = check_perm file => $opt_filemode;
    $opt_dirmode = check_perm directory => $opt_dirmode;