Link to home
Start Free TrialLog in
Avatar of tmbb
tmbb

asked on

Super easy for lots of points

When printing text with print, is there a \ tag or other way of making the " character.  I will be using many " and many variables, so using  print <<'end_tag'; for every quote is much too cumbersome.
Avatar of ozo
ozo
Flag of United States of America image

print "\"$variable\"";
print '"';
print q(");
print q/"/;
print qq("$variable");
print qq/"$variable"/;
print '"',$variable,'"';
print <<"end_tag";
"$variable0"
"$variable1"
"$variable2"
"$variable3"
end_tag

Avatar of tmbb
tmbb

ASKER

I am so freaking stupid.  Just after posting this I realized that variable substitution occurs in << print.  Well, thanks for a speedy and complete answer - post it and I'll give the points.
Just to be clear, variable substitution occurs in
<<"end_tag"
but not in
<<'end_tag'
By the way, the answer to the original question (how to print a '"') is \"

ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial