$name = "joe";
$color = 'red';
 
$number1 = 42;
$number2 = '42';
 
# This evaluates to true
if ($number1 == $number2) { print "Numbers and strings of numbers are the same!"; }
 
$answer = "The answer is $number1"; # Variable interpolation: The answer is 42
$price = 'This device costs $42'; # No interpolation in single quotes
 
$album = "It's David Bowie's \"Heroes\""; # literal quotes inside a string;
$album = 'It\'s David Bowie\'s "Heroes"'; # same as above with single quotes;
$album = q(It's David Bowie's "Heroes"); # the quote-like operators q() and qq() allow
 # almost any delimiter instead of quotes, to
 # avoid excessive backslashing
 
$multilined_string =<<EOF;
This is my multilined string
note that I am terminating it with the "EOF" word.
EOF