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

Re: [PBML] Opening multiple files at once....

Expand Messages
  • Tom Barron
    ... If your platform is Unix, open(FILE, cat file1 file2 file3 file4 | ); my @contents = ; close(FILE); -- Tom
    Message 1 of 2 , Dec 29, 2000
    • 0 Attachment
      Steve Milo wrote:
      > ...
      > my @FILES = ("file1", "file2", "file3", "file4");
      > ...
      > open (FILE, "@FILES") || die;
      > ...
      > my @contents = <FILE>;
      >
      > I've come to conclusion that the only way to accomplish this is to do
      > a foreach on @FILES. Then open and close until I have all the
      > contents. Is there any other way to accomplish this.

      If your platform is Unix,

      open(FILE, "cat file1 file2 file3 file4 |");
      my @contents = <FILE>;
      close(FILE);

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