http://qs1969.pair.com?node_id=874685

Angharad has asked for the wisdom of the Perl Monks concerning the following question:

I am about to write a script that takes a particular 'identifier' - just a piece of text really taken from the command line and then I want to go though a number of files within a particular directory and open them up one at a time.
Each of these files would then searched for the one that contains this 'identifier' and then print out the name of that file to the screen.
I'm aware, however, that opening a large number of files once at a time and then searching though them a line at a time just to hunt out a piece of text might be a slow and memory hungry method.
Can anyone think of a sensible approach to writing this script? Any suggestions much appreciated