Do you know where your variables are? | |
PerlMonks |
Re^7: Data::Dumper outputby afoken (Chancellor) |
on May 09, 2021 at 09:51 UTC ( [id://11132297]=note: print w/replies, xml ) | Need Help?? |
say outputs a trailing newline unless the arguments already contain a trailing newline. D'oh! Of course, you are right, say simply appends a newline, and that's also what's written in the documentation. The "add a newline unless there is already one" is my mental model of say, and my code never proved me wrong - because I never called it with a string already containing a trailing newline. And to make things worse, I even linked to the documentation in Re^5: Data::Dumper output. I wonder why my mental model of say is wrong. A blame on perlfunc states that the documentation hasn't changed for two years, and has no relevant changes since say was introduced. Alexander
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
In Section
Seekers of Perl Wisdom
|
|