sub read_file_inarray {
  local $file = $_[0];
  local @lines;
  local $/="\n";  # this for set the separator
  open ( R, "$file" );
  @lines=<R>;
  close ( R );
  for ( my $a=0;$a<=$#lines;$a++ ) { chop $lines[$a] }   # if you dont want to find again the separator in your array
  return ( @lines);
}
 
@lines = &read_file_inarray("your_file");
 
in this case you will have one line for each value of @lines
 
default value of $/ is "\n";
 
I hope it was this you were looking for
 
bye
 
 
 -----Original Message-----
From: Rodrigo [mailto:[EMAIL PROTECTED]]
Sent: lundi 25 mars 2002 04:17
To: '3'; '1'; '2'
Subject: Read lines in txt

Hi IŽd like to know to open lines in a text file and to put the values of it in an array.

There IŽd like to read or write to these text files. How the arrays would store the data

since there would be no special character separator.

Thanks, Rodrigo.

Reply via email to