Scalar variable in Perl.

วันจันทร์ที่ 14 กันยายน พ.ศ. 2552

Scalar variables are common variables that can be either numeric character string, such as time.

$ a = "8"; # $ a variable is a string value "8".

$ b = 5; # variable $ b is a numeric value 5.

$ c = $ a 5; # remove string variables. (Plus symbol) to figure it will be immediately converted to numbers. Therefore, in this case would have cost $ c variable is 13.

$ d = $ a. "1"; # remove string variables. (symbol dot) with any number or string. Up to a string value. Therefore, in this case, the variable $ d to have a "81".

0 ความคิดเห็น:

แสดงความคิดเห็น

 
 
 
 
Copyright © Basic Perl