You could use a system call to do it from within your script.
system "chmod -R $directory";
Otherwise if you really wanted or needed to use Perl's
chmod function it takes a list of files so you could either use
File::Find to construct a list beforehand or use
File::Find and chmod on each of the files individually. Your easiest solution would be a
system calll. If you really want to do it the other way you may want to reference
How do I recursively process files through directories