Putting Two Strings Together, Concatenate
To put two strings or variables together:
$ft="London and " . "Paris";
print "$ft";
Which prints:
London and Paris
Next Example: When you concatenate variables, you don't need the quotation marks.
$city1="London";
$city2="Tokyo";
$ft=$city1 . " and " . $city2;
print "$ft";
Which prints:
London and Tokyo
-We wrapped in quotations the word
and with a space on each side so it would print nicely.
Copy and Paste Perl Code:
#!/usr/bin/perl
print "Content-type:text/html\n\n";
$city1="London";
$city2="Tokyo";
$ft=$city1 . " and " . $city2;
print "$ft";
exit;