Programming Languages
C#
Subjective
Mar 14, 2013
How to concatenate strings with Perl?
Detailed Explanation
Method #1 - using Perl's dot operator:
$name = 'checkbook';
$filename = "/tmp/" . $name . ".tmp";
Method #2 - using Perl's join function
$name = "checkbook";
$filename = join "", "/tmp/", $name, ".tmp";
Method #3 - usual way of concatenating strings
$filename = "/tmp/${name}.tmp";
Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts