use File::Find; use strict; use warnings; find(sub { print $File::Find::name if /\.(?:h|c|sh)$/; }, '.');