in reply to Searching Line by Line Multiple Times

After going through your <STDIN> handle once, you are now at the EOL position, meaning no more data can be read from your handle.

You would be better off reading <STDIN> contents into an ARRAY and then looping through that ARRAY in your foreach.

  • Comment on Re: Searching Line by Line Multiple Times