[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SLUG] Dir List

On Fri, Jun 15, 2001 at 12:02:16PM +1000, Jamie Wilkinson wrote:

> >a perl solution is preferred.

from the Perl Cookbook:

    use File::Find;
    sub process_file {
        # do whatever;
    find(\&process_file, @nospam.DIRLIST);

    This simple example demonstrates File::Find. We give find an
    anonymous subroutine that prints the name of each file visited and
    adds a / to the names of directories:

    @nospam.ARGV = qw(.) unless @nospam.ARGV;                      
    use File::Find;                      
    find sub { print $File::Find::name, -d && '/', "\n" }, @nospam.ARGV;

#ozone/algorithm <ozone@nospam.algorithm.com.au>          - trust.in.love.to.save

SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug