I've been trying to make a very simple message board where I post form field info on a single line. However, I realized that if a carriage return is used in one of the fields, then when I try to read and output the information, the formatting in the file is all messed up. As of now, I've been reading line by line, which isn't working out because of the carriage returns in the file.
Does anyone have suggestions for either A) outputting the data to a file so that I can keep the information blocks separate (while including the formatting of the text fields), or B) reading the data from the file across multiple lines and parsing the data into appropriate blocks. Right now I'm using the Split function to break the data from a single line into different variables, but that doesn't work with carriage returns.
outputted file example:
12/24/80 @ 9PM,,,John,,,test,,,
2/13/80 @ 4PM,,,John,,,this with part has carriage
returns and uses multiple lines for a single block of data,,,
12/24/80 @ 9PM,,,John,,,test,,,
I'd greatly appreciate any help since I'm still new to perl. I'm not sure whether or not I can use a delimiter to place in front of each line to break up the data into blocks, or use a hash or what. Thanks in advance.
-John
Does anyone have suggestions for either A) outputting the data to a file so that I can keep the information blocks separate (while including the formatting of the text fields), or B) reading the data from the file across multiple lines and parsing the data into appropriate blocks. Right now I'm using the Split function to break the data from a single line into different variables, but that doesn't work with carriage returns.
outputted file example:
12/24/80 @ 9PM,,,John,,,test,,,
2/13/80 @ 4PM,,,John,,,this with part has carriage
returns and uses multiple lines for a single block of data,,,
12/24/80 @ 9PM,,,John,,,test,,,
I'd greatly appreciate any help since I'm still new to perl. I'm not sure whether or not I can use a delimiter to place in front of each line to break up the data into blocks, or use a hash or what. Thanks in advance.
-John