Hi
I am reading a text field from an XML feed. When I view that field in various ways eg with vi I can see the plain text is formatted in lines and paragraphs. So i want to substitute newlines for say 'fred'. I've tried the following with no success
$p_desc=~s/\n/fred/g;
$p_desc=~s/\n\r/fred/g;
$p_desc=~s/^$/fred/g;
$p_desc=~s/^ *$/fred/g;
Can you help? Should I be splitting?
I am reading a text field from an XML feed. When I view that field in various ways eg with vi I can see the plain text is formatted in lines and paragraphs. So i want to substitute newlines for say 'fred'. I've tried the following with no success
$p_desc=~s/\n/fred/g;
$p_desc=~s/\n\r/fred/g;
$p_desc=~s/^$/fred/g;
$p_desc=~s/^ *$/fred/g;
Can you help? Should I be splitting?