On Mar 6, siren jones said:

>I have a file containing a list of names, for example:
>
>S2000123456.met
>S2000123457.ozone
>S2000123458.hdr
>S2000234569.met
>
>I'm looking for a short way to read these filenames onto an array.

Open the file, read the text to an array, close the file.  How much
shorter would you like it?

  open FILES, "< file-list" or die "can't read file-list: $!";
  chomp(my @files = <FILES>);
  close FILES;

You might even be able to use

  while (<FILES>) {
    chomp;
    # use $_ here
  }

if you don't NEED the files in an array, but can work with them one at a
time.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to