Perl Single and Double Quotes
Single Quotes – do not interpret inside the quotes.
Double Quotes – interpret inside the quotes.
Single Quotes Example:
$variable = ‘hello world’;
print ‘Say $variable.’;
Output:
Say $variable.
Double Quotes Example:
variable = ‘hello world’;
print “Say $variable.”;
Output:
Say hello world.
Single and Double Quotes Example:
$what = “brontosaurus steak”;
$n = 3;
print “Fred ate $n $what.\n”;
print ‘Fred ate $n $what.’;
output:
Fred ate 3 brontosaurus steak.
Fred ate $n $what.
Single and Double quoted equivalent:
$email = “Info\@ConfigNotes.com”;
or
$email = ‘Info@ConfigNotes.com’;
Categories: Perl Tags: