Cyber Sentry
Application Development
System Architecture Design
Technical Due Diligence
Qmail Support and Consultancy
Scripting Help
Partners
Client Testimonials
Help Sections
Software Patents
Site Map
Contact us
Community
Home

Outputing Variables

Lets try to output some of our new variables....The following code prints the string "nuts and bolts" using concatenation:

 

$a = 'nuts';

$b = 'bolts';

print $a.' and '.$b;

 

It would be nicer to include only one string in the final print statement, but the line

 

print '$a and $b';

 

prints literally $a and $b which isn't very helpful. Instead we can use the double quotes in place of the single quotes:

 

print "$a and $b";

 

The double quotes force interpolation of any codes, this causes Perl to evaluate the values of the $a and $b variables.

 

Other codes that are interpolated include special characters such as newline and tab. The code \n is a newline and \t is a tab.



Qmail Help Section
Perl Tutorial
Linux Command Line Help
Top top Copyright Cyber Sentry Ltd  

Cyber Sentry -- Application Development Sitemap 1 2 3