Perl q Function



Description

This function can be used instead of single quotes. This is not really a function, more like an operator, but you'll probably look here if you see it in another programmer's program without remembering what it is. You can actually use any set of delimiters, not just the parentheses.

Syntax

Following is the simple syntax for this function −

q ( string )

Return Value

This function retuns a single-quoted string.

Example

Following is the example code showing its basic usage −

#!/usr/bin/perl -w

$var = 10;
print(q(This is a single quoted string without interpolation, $var));
perl_function_references.htm
Advertisements