in reply to Storing multi-line form data in a flat file?
The problem being that if someone used '##' in their string, that would be replaced by \n on the return loop.my $replacement = "##"; $multiline_data =~ s/\n\r?/$replacement/g; print <OUTFILE> $multiline_data; ... my $read_data = <INFILE>; $read_data =~ s/$replacement/\n/g;
A better option is that you store the multiline data into it's own file separate from the flat file, the filename related to an id or the like. This way, you preserve the \n and don't have a problem with losing someone's text.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Storing multi-line form data in a flat file?
by SilverB1rd (Scribe) on Mar 15, 2001 at 02:20 UTC |