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

Scalar variables

Lets look at variables. These allow us to perform some computational experiments with Perl.

 

donate israel

Perls most basic variable is the scalar variable. Scalar variables hold both strings and numbers, and are remarkable in that strings and numbers are completely interchangable. For example, the statement

 

$virus_type = 9;

 

sets the scalar variable $virus_type to 9, but you can also assign a string in a similar way:

 

$virus_type = 'nine';

 

Perl also accepts numbers as strings, like this:

 

$email_number = '9';

$email_number = '0009';

 

Once you have declared a variable, like above, you can perform many computational tasks on them.

 

Name Conventions

 

Variable names must follow these conventions:

 

1. must be made from characters, numbers or underscores

2. must start with either characters or numbers....not underscores

3. can not start with $_

4. are case sensetive ....ie Temp and TEMP are diferent variables.

 



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

Cyber Sentry -- Application Development Sitemap 1 2 3