Perl q/STRING/ is rather an operator than a function. You can use it instead of single quotes. Because it returns a single quoted string, the interpolation is not allowed.
Instead of slashes you can use any set of delimiters you want. If you use parentheses as delimiters, its syntax looks like a function, where string is the argument:
Single quotes are used to enclose data you want taken literally. See the following example:
my $str = 'The pencil is mine.';
print "$str\n";
# the same thing:
$str = q/The pencil is mine./;
print "$str\n";
The output:The pencil is mine.
The pencil is mine.
Check my new How To Tutorial eBook (PDF format):to see a lot of fully commented examples that help you use the q/STRING/ function in your scripts.
NEW!!!
Do you want more information about the basic Perl topics?
Check my new "Perl How To" Tutorial eBooks page where I'll answer the most frequent questions regarding some topics :