in reply to How do I escape '#' pound sign?

Simply by putting the pound inside quotes:
$val = q(#); $val2= "#";