#!/usr/bin/perl -w use strict; use File::Find; print "Enter the directory to start searching in: "; chomp(my $dir = ); # find takes a subroutine reference and the directory to start working from. find (\&wanted, $dir); sub wanted { if(/\.pl$/) { # See if it’s a .pl file print "$File::Find::name\n"; # Print the current file name. } }