Mega Code Archive

 
Categories / Perl / String
 

A string is a sequence of bytes (characters) enclosed in quotes

#The following shows three ways to quote a string: #    Single quotes: 'It rains in Spain'; #    Double quotes: "It rains in Spain"; #    Here document: #            print <<END; #                   It #                   rains in #                   Spain #            END $question = 'wouldn\'t mind';        # Single quotes $answer = '"No."';                   # Single quotes $line = "\t it isn't \n"; $temperature = "78"; print "It is currently $temperature degrees"; # Variables are interpreted when enclosed in double quotes, but not single quotes