Perl: Variables
In Perl, we need not decalare a varibale type. Meaning a variable can hold both a string or a number. All the variables in perl are preceded by a $ sign as follows: $name="david"; Again, just perl does not care about the type, you can simply reassign it to a number: $name=0; You can perform operations now: $name++; Perl can accept numbers as strings and perform arithmetic operations:
#!/usr/local/bin/perl $name='99'; $name++; print $name;
The above program would give 100 as the output. Variables in perl are case-sensitve and therefore, $name and $Name are different. Variable name can consist of numbers, letters and underscores. It should not start with a number.