shadowline
Basics << Scalar Data >> Quotes
Scalar data is an individual piece of data. In JavaScript it would be the same as a variable. Bascially, it is an invisible container that has a name label on it and it holds a value inside of it.

Scalar data is symbolized by a $ sign.
For correct processing, the $ must be followed by a letter (non-numeric) character.
Scalar names are CaSe SeNsItIvE. $A is different than $a.
You can use up to 255 characters for a scalar name which includes numbers, letters, and underscores.

Assigning or changine values of a scalar is as easy as an equals sign. Here are some quick examples :
$a=5      #a contains value of 5
$b=12     #b contains value of 12
$a=$b     #a now contains value of 12

There are two types of data values. NUMBERS and STRINGS.

Numbers are characters ranging from 0 to 9. No letters or other symbols.

Strings are a collection of characters which my include : letters, numbers and/or symbols. Strings can be a word, sentence, or even just a number.


Strings come in two varieties. CONSTANTS and VARIABLES.

String constants are a set value. They do not change.
print "Hello World!";
The value specified "Hello World!" will not change. It is a solid string constant.

String variables are quite different. They are containers with a name label on them. The value (contents) of the container may change. The NAME of the string variable should be descriptive.

You can tell a string variable as it starts with one of these symbols $ @ %. The $ represents a scalar variable, the @ represents an array, and the % represents a hash. All of these variable types have a unique function and will be discussed in detail as you go through these tutorials further. Here is a quick example though...
$mymessage="Hello World!";
print $mymessage;
$mymessage="Bye World!";
print $mymessage;
Basics << Scalar Data >> Quotes
shadow

Advertise in the banner along the top, Click here!

Valid XHTML 1.0 Transitional Valid CSS! Text Link Ads
shadow
shadow