Perl | q operator
Last Updated :
07 May, 2019
q operator in Perl can be used in place of single quotes. It uses a set of parentheses to surround the string.
Syntax: q (string)
Returns: a single-quoted string.
Note: Any set of delimiters can be used, not just the parentheses.
Example 1:
print ( q(Geeks For Geeks) );
|
Example 2:
$var = 25;
print ( q(Welcome to GFG, $var) );
|
Output:
Welcome to GFG, $var
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...