Main( @ARGV ); exit( 0 ); sub Main { my @files = RecursivePathSearch( $path ); for my $file ( @files ){ SomethingHere( $file ); } } sub RecursivePathSearch { my( $path ) = @_; use File::Find::Rule qw/ find rule/ return rule( file => not_name => [ '*.pl', ], )->in( $path ); } sub SomethingHere { my( $file ) = @_; use Path::Tiny qw/ path /; use Email::Address; my $stuff = path( $file )->slurp_raw; return Email::Address->parse( $stuff ); }