more useful options | |
PerlMonks |
Re: How do I concatenate a string?by davido (Cardinal) |
on Sep 14, 2003 at 02:49 UTC ( [id://291337]=note: print w/replies, xml ) | Need Help?? |
For simple concatenation,
For concatenating the new string to the end of the existing string (appending):
For concatenating multiple strings all at once, use join. Join is (according to the Camel book) the most efficient way to concatenate many strings together. Join can be used with a delimiter, or with a null string as the delimiter, so that nothing is inserted between the strings that are joined (concatenated) together.
Join can do a lot more than just simple concatenation. Whatever you put between the quotes will be inserted between the strings that are being joined together. Also, join can accept not just a list of scalar variables, but also an array, or a list of literal strings.
In Section
Seekers of Perl Wisdom
|
|