Mega Code Archive

 
Categories / Perl / String
 

Strings are normally delimited by a matched pair of either double or single quotes

$name="Tom"; print "Hello, $name.\n";# $name and \n evaluated print 'Hello, $name.\n';# String is literal; newline not interpreted print "I don't care!\n";# \n is interpreted in double quotes print 'I don\'t care!', "\n";# Backslash protects single quote in string "don\'t"