You still shouldn't read the filenames from STDIN. What you mention can and should be done by the shell: show-the-alarms `ls *.log`. Adding this ill-advised "functionality" to the script will only make it unnecessarily difficult to parse data not coming from a file.
Makeshifts last the longest.
Comment on Re^3: when reading a file how to print a line one above the current line??