Reading Data From a File
-
Now that you have written to a file, you might as well read some data back.
-
Not always: you might just want to generate HTML, or you might send an
e-mail.
-
To do so,
-
Open the file witn <,
-
Read each line into an array with the syntax @array = <filehandle>
-
Close the file,
-
Do something with the resulting array.
open(DATA, "<../userdata.txt") || &error;
@dataFromFile = <DATA>;
close(DATA);
Example: What
I said
writetofile.pl source
whatIsaid.pl source
Using hidden fields
Home