[...] Perl single quotes do not interpolate their contents, unlike the double quotes [...]
One fine point to add is that the delimiting character needs to be escaped in single quotes and the backslash itself will be escaped if there are two in a row.
use warnings;
use strict;
#my $y1 = ' \'; ## error
my $y1 = ' \\'; ## produces ' \'
#my $y2 = q{\}; ## error
my $y2 = q{ \\}; ## produces ' \'
my $y3 = q{\\share\dir\\}; ## produces '\share\dir\'
my $y4 = ' \''; ## produces " '"
my $y5 = q{ \}}; ## produces ' }'
print "y1<$y1>\n";
print "y2<$y2>\n";
print "y3<$y3>\n";
print "y4<$y4>\n";
print "y5<$y5>\n";
__DATA__
y1< \>
y2< \>
y3<\share\dir\>
y4< '>
y5< }>