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


in reply to Find a filename in a text file

Maybe you'll find useful the  -f operator. perldoc -f -f