How many ways can we express string in Perl

Q

How many ways can we express string in Perl?

✍: Guest

A

Many. For example 'this is a string' can be expressed as:

  • 'this is a string'
  • "this is a string"
  • qq/this is a string like double-quoted string/
  • qq^this is a string like double-quoted string^
  • q/this is a string/
  • q&this is a string&
  • q(this is a string)

2007-11-26, 4868👍, 0💬