Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: How would you go about it?

by Aristotle (Chancellor)
on Jul 26, 2004 at 02:18 UTC ( [id://377338]=note: print w/replies, xml ) Need Help??

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;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://377338]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-18 12:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found