use Win32::Perms; $Source = $ARGV[0] || die; $Dest = $ARGV[1] || die; $Recurse = 1 if( $ARGV[2] =~ /^[-\/]r/i ); print "Setting permissions on $Dest.\n\n"; print "First get the permissions from $Source...\n"; $Perms = new Win32::Perms( $Source ) || die; print "Now setting permissions..."; print "with recursion..." if( $Recurse ); print "\n"; if( $Recurse ) { $Result = $Perms->SetRecurse( $Dest ); } else { $Result = $Perms->Set( $Dest ); } print "Permissions " . (($Result)? "were successfully set" : "failed to set" ) . ".\n";