develooper Front page | perl.beginners | Postings from March 2002

simple file reading question

Thread Next
From:
siren jones
Date:
March 6, 2002 07:14
Subject:
simple file reading question
Message ID:
LAW2-F1427mvjkO22Zh00001721@hotmail.com

I have a file containing a list of names, for example:

S2000123456.met
S2000123457.ozone
S2000123458.hdr
S2000234569.met
   .
   . etc.

I'm looking for a short way to read these filenames onto an array.

I tried:

my @fils = <$indir/filename>;

..... but this just gives me the name of my input file

I can do this, but it seems cumbersome.

     open LF or die "Can not find file: \n $infile $!\n";
      sysread LF, $filename, 50000;
      @imgs = split(/\n/,$filename);
      close (LF);

Thank you in advance.

-s




_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About