Answer:
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";
$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";
Previous Question | Next Question |
What is the easiest way to download the contents of a URL with Perl? | How do I read command-line arguments with Perl? |