#!/bin/perl -w use strict; use File::Find; my @directories = ('.'); find( sub { # This sub gets passed the current filename relative to # the directory file::find recurses into - this is # weird and leads to many a confusing error. # Instead, I use $File::Find::name, which always gives # the full path (relative to the directory you were # in when you started File::Find). my( $filename ) = @_; print $File::Find::name, "\n"; print $filename, "\n"; }, @directories );