Loading ...
Sorry, an error occurred while loading the content.
 

Re: Read a file as input

Expand Messages
  • b_harnish
    ... hostname . ... That all depends on how you want it to be read as input. If you want to use STDIN (usually the easiest), just put
    Message 1 of 2 , Apr 2, 2002
      --- In perl-beginner@y..., "Nguyen, David M" <david.m.nguyen@x>
      wrote:
      > I have couple hundreds of host names saved into a file called
      "hostname".
      > How do I tell my perl script to read that file as input?
      >
      > Thanks,
      > David

      That all depends on how you want it to be read as input.

      If you want to use STDIN (usually the easiest), just put "<
      hostname" at the end of the command line when you run the script.
      Then just read from the filehandle STDIN (no need to open or close
      it).

      Otherwise, follow the directions to open/close/read (not in that
      order) a file.

      - Brian
    Your message has been successfully submitted and would be delivered to recipients shortly.