in reply to Re: substr to split lines?
in thread substr to split lines?

I'm not sure how your solution is to work with what I need to do though. (Probably because of my lack of understanding with regards to substr).

The way the code reads now is:
$description =~ s/^(\s+)?$//sg; $description =~ s/\n/ /sg; while ($description) { $f_desc .= "T".(substr($description,0,75) = "")."\n"; } print $f_desc;
However, when given a description like the following (which is what I am working with) it doesn't come out quite right.
2001/08/28 10:15:54 AM auser 08/28/01 10:15:53 auser PostalCode.24th floor. MachineID, printer keeps jamming (A person' +s Name). Lexmark optra s1250. 2001/08/28 10:17:57 AM auser PostalCode.24th floor. MachineID, printer keeps jamming (A person's N +ame). Lexmark optra s1250.
The above code makes it read like:
T floor. MachineID, printer keeps jamming (A person's Name). Lexmark +optra s125 T0. 2001/08/28 10:17:57 AM auser PostalCode.24th floor. MachineID, +printer kee Tps jamming (A person's Name). Lexmark optra s1250. T
So it looks like I'm missing the first line, and I'm not sure why :-)
UPDATE: Japhy got it. That's why he's the saint and I'm the lowly whatever I am now :-)