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.
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'
<<"end_tag"
but not in
<<'end_tag'
By the way, the answer to the original question (how to print a '"') is \"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
print '"';
print q(");
print q/"/;
print qq("$variable");
print qq/"$variable"/;
print '"',$variable,'"';
print <<"end_tag";
"$variable0"
"$variable1"
"$variable2"
"$variable3"
end_tag