Perl - Tpl file - Need to replace new line character.
Hi, m brand new to Perl programming..
We have one .tpl file, which has code to read data from xml file and generate html using this data.
xml data has new line characters. We want to remove this new line character before generating html file.
newdocument.write('<iw_value name='dcr.Important Information' />');
Here '<iw_value name='dcr.Important Information' />' returns string having new line character.
You can also use tr to delete one char :
cat xml_file.xml | tr -d '\n' > xml_file.xml.new
or if the file is read line by line inside Perl script, just :
Have found solution:
Following code works fine. Thanks to all of u..
my $str = iwpt_dcr_value( 'dcr.Important Information' );
$str =~ s/\n/<br \/>/g;
$str =~ s/\'/\\'/g;
|All times are GMT -5. The time now is 07:13 AM.|