http://www.perlmonks.org?node_id=1055536


in reply to Re: Find a file with same name but different extension
in thread Find a file with same name but different extension

This seems like a good place to use Tie::File instead of File::Slurp since you only need the first few lines of the files.