in reply to Re^2: Print a big string formatted and in multiple lines
in thread Print a big string formatted and in multiple lines
Hi alen129,
s/\\n/<br>\n/g is a search-and-replace regular expression, a good place to start is perlretut and perlrequick.
Interpolation ('\n' vs. "\n" vs. "\\n") is discussed in a few different places, for example a bit in Scalar value constructors and Quote and Quote like Operators.
Also, as mentioned as one of the points in the Basic debugging checklist, it's probably a good habit to get into to use a module like Data::Dumper or Data::Dump to look at the content your variables:
my $Detail = 'Sep 30 2016 8:32AM CHP\nSep 30 2016 8:32AM SANTA ANA\n'; use Data::Dumper; $Data::Dumper::Useqq=1; print Dumper $Detail; # - or - use Data::Dump 'dump'; print dump $Detail;
Both will unambiguously show you the content of the string in Perl's syntax, for example "Sep 30 2016 8:32AM CHP\\nSep 30 2016 8:32AM SANTA ANA\\n".
Hope this helps,
-- Hauke D
|
|---|