Perl uses single or double quotes to surround a zero

Q

Perl uses single or double quotes to surround a zero or more characters. Are the single(' ') or double quotes (" ") identical?

✍: Guest

A

They are not identical. There are several differences between using single quotes and double quotes for strings:

  • The double-quoted string will perform variable interpolation on its contents. That is, any variable references inside the quotes will be replaced by the actual values.
  • The single-quoted string will not perform any variable interpolation. It doesn't care the dollar signs.
  • The double-quoted string can contain the escape characters like newline, tab, carraige return, etc.
  • The single-quoted string can contain the escape characters like single quote, backward slash, etc.

2007-11-26, 4614👍, 0💬