Finding Old Things
Randal L. Schwartz
One of the great things about the Perl community is seen in the many ways
that Perl information can be obtained to solve typical tasks or to get past
those sticky little problems. Besides the professional documentation, theres
also the myriad of man pages that come with the Perl distribution itself, and
the CPAN modules. And with a little searching on the Net, you can quickly find
very active support for Perl in the way of Usenet newsgroups, mailing lists,
and a few Web communities.
The most active Perl Web community that I participate in is known as the Perl
Monastery, at http://perlmonks.org.
Each day, a few hundred active users and a few thousand visitors post and answer
questions and chat in the chatterbox. In my past role as a systems
administrator, it seems like I was always under pressure to solve problems in
annoyingly brief amounts of time. Therefore, the Monastery is a welcome resource,
because questions often get answered within minutes, so help is just a browser-reload
or two away.
Recently, a relatively new Monk (as we call the participants) who goes by the name Aquilo asked for help with a script that:
recurses through a directory structure and checks if more than half of the
files in that directory have been used in the past 180 days. The path of directories
which are predominately unused is appended to a list of directories which will
be used to archive them.
Aquilo gave some sample code that performed directory recursion in the traditional beginner way. I say traditional, because one of Perls rites of passage seems to be to write a directory recursion routine. Generally, these solutions are not as flexible or efficient or portable as Perls built-in File::Find module, but beginners generally arent aware of this module.<>
|