I have been studying W/R to files...
W/R to a string and to an array.
and I must say I think I have it.

I can read a file into an array IF i wrote the file using "\n" between vars, yes????

and I can read the entire file into a string (to later be split) by using delimiters 
like ","    yes???

I have some data files that hold lists (like cities) that I want in an array.
and some files that hold a collection of vars (name, city, color, cartype, etc) that I 
want to delimit and later read as a string ($Slurp) and then ($name, $city, $color, 
$cartype, $etc)=split (",",$Slurp)

my question is if I write a file using delimiters like ","  can I later read the 
entire file into a string and then
@Cities = split (",",$Slurp) ??????

but how do I read a file that used the "\n" and then split it later???
right now i wold have to
open file...
@Array=<read entire file into @Array>
close file

and then...

$name=$Array[1];
$city=$Array[2];
$color=$Array[3];
$cartype=$Array[4];
$etc=$Array[5];

there must be a better way like ?????
$name, $city, $color, $cartype, $etc)[EMAIL PROTECTED];

of can I split using the special var $\ or \n as a delimiter????????

?????????? am I making the example clear?????????
or am i trying to do the impossible?

Comment WITH example correction welcome..
the above syntax may not be completely correct....
but it gives you the idea...so please dont crusify me for it...

Lou

Reply via email to