#Perl : differences between double-quoted strings and single-quoted strings.
# Hello World Program in Perl
#
$string = "a string";
$text1 = "This is $string"; # becomes "This is a string"
$text3 = 'This string contains \', a quote character';
$text4 = 'This string ends with a backslash \\';
print "$text1 \n";
print "$text2 \n";
print "$text3 \n";
print "$text4 \n";
Result
This is a string
Result
This is a string
This is $string
This string contains ', a quote character
This string ends with a backslash \
No comments:
Post a Comment