#! /usr/bin/perl -w use strict; use File::Find (); # Set the variable $File::Find::dont_use_nlink if you're using AFS, # since AFS cheats. # for the convenience of &wanted calls, including -eval statements: use vars qw/*name *dir *prune/; *name = *File::Find::name; *dir = *File::Find::dir; *prune = *File::Find::prune; # Traverse desired filesystems File::Find::find({wanted => \&wanted}, 'ham', 'spam'); exit; sub wanted { if ( -f $_ ) { $name =~ m@^([^/]+)@; print "$1:mbox:$name\n"; } }