dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Web
Expertise: Beginner
Mar 10, 1999

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


The qq Function for Long Strings in Perl

If you write CGI programs in Perl, you probably find yourself using a lot of long print statements for outputting HTML. HTML uses a lot of double quotes, so it's better if you don't have to escape every " you use. You can accomplish this with the qq function, which will interpolate all variables but ignores double quotes. For example:
 
print qq^
	<HTML>
	<BODY BGCOLOR="#FFFFFF" LINK="#003366" VLINK="#666666">
	$bodyText
	</BODY>
	</HTML>
^;
In this example, I've used ^ for a delimiter, but you can use anything you want.
Steve Renaker
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date