Start Learn to writing Perl
To learn programming languages, the first you must know the basics of each language in the perl language is in the form processing script interpreter to complie line by line. The perl programming language in which each first. It shall be the initial form type variables and operators
, are two types of a scalar variable and associate. But it is similar to the type of information in other languages.Variables such as number, text
Operators have a basic mathematical operations like other languages.But it is any other language. This will see the following example perl language.
#!/usr/bin/perl -w
$num = 9;
$strnum = '9';
print $num + $strnum . "\n";
$mystring = 'Thaicoding';
print $mystring. "\n";
#print $num + $mystring;
$myfloat = 4.5;
print $myfloat + $num . "\n";
#-----Operator------
$a = 2 ** 10;
print $a . "\n";
$b = "a";
print $b x 3 . "\n";
The results showed that the samples of the Perl scalar variable is a variable is a variable that stores data and can convert different types of information as to lead to positive int with string to a numeric string, but only as
Example
$num = 9;
$strnum = ’9′;
print $num + $strnum . “\n”;
but cautions that the positive values of different data types, the program will error if I try to make it a comment line # print $ num + $ mystring; This issue is language in the comment use # for perl.
In the later will be Part of the mathematical operations which have deliberate then it is + + front brake or - - page - - the same as in other languages in this section will not mention, but we will talk about the action. Special to other languages such as $ a = 2 ** 10; This will raise the power use * 2.
Then this print $ b x 3. "\n"; Will reproduce results obtained in the example is a 3 shows the the same sort.
Almost forgot Another of the string in perl will mark just like php use . in
concatenation.
This article is begining in perl, but do not want to start teaching about print hello word, because it will waste time learning.
Another was told to forget. #!/usr/bin/perl -w bread that is a telling OS that the program in usr / bin / perl that if a version of window do not have time to write, but in unix need to write The -w is to show the warning message itself.
Download Sourcecode
Original Translate
Start Learn to writing Perl.
Read More