We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Super easy for lots of points

tmbb
tmbb asked
on
Medium Priority
171 Views
Last Modified: 2011-09-20
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.
Comment
Watch Question

ozo
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015

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

Author

Commented:
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.
ozo
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015

Commented:
Just to be clear, variable substitution occurs in
<<"end_tag"
but not in
<<'end_tag'

Commented:
By the way, the answer to the original question (how to print a '"') is \"

CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.