Browse DevX
Sign up for e-mail newsletters from DevX

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



Building the Right Environment to Support AI, Machine Learning and Deep Learning

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^
	<BODY BGCOLOR="#FFFFFF" LINK="#003366" VLINK="#666666">
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.



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