#!/usr/bin/perl -w use File::Find; sub wanted { -d && chmod 0755, $_; -f && chmod 0644, $_; } if (@ARGV == 0) { push @ARGV, "."; } find(\&wanted, @ARGV);