perl-filesystem

How to get properties of a directory using perl script?

I want to get the details of a directory as like number of files and subdirectories in it and permissions for those. Yes! it's easy to do it on linux machines using back ticks to execute a command.But is there a way to make the script platform independent. thanks :) ...