Thursday, May 10, 2012

What is the difference between "Print 'Hi $First_Name';" and "Print "Hi $First_Name";"?

The first statement in single quotes will be treated as a constatnt string. The value assigned to the variable would not be the outcome. Rather the output would be :

Hi $First_Name

On the other hand, the second statement would replace the variable with the actual value and the output would be :

Hi <Value Assigned to the variable>

No comments :