in reply to How to read contents of a file without opening it and print the contents

open is a prerequisite to reading any file by name. You cannot do it otherwise.

You can pipe the content of a file into your program. That input will then be available in the STDIN filehandle.

  • Comment on Re: How to read contents of a file without opening it and print the contents