laziness, impatience, and hubris | |
PerlMonks |
Re: String concatenationby petdance (Parson) |
on Apr 11, 2012 at 21:04 UTC ( [id://964627]=note: print w/replies, xml ) | Need Help?? |
Use whichever most clearly shows the intent of your code. I can see cases for concatenation and interpolation and join().
For example, I prefer the first one in this example. I think it feels more like reading prose.
But say you're building a string to show the time. I think the first highlights the elements that are being used to build $date.
And sometimes it doesn't make sense to interpolate or join and you just concatenate. Bottom line: Go for what is most expressive, and makes the code clearest to the reader. Assume that any microseconds you shave will be insignificant.
xoxo,
In Section
Seekers of Perl Wisdom
|
|