Using the "." Operator 

Using the "." operator 
  • Another cool Perl trick is the use of the "." operator that "appends" a value to an already existing scalar variable. Thus, the following code would print out "Selena Sol": 
  • $name = "Selena" . " Sol"; 
    print "$name"; 
  • An alternative shorthand for appending to scalar variables is using the ".=" operator. For example, the following code does the same thing as the code above. 
  • $name = "Selena"; 
    $name .= " Sol"; 
    print "$name\n"; 
Using Scalars
Table of Contents
Cropping scalar variables with the chop function


Graphics & Media Lab. >> Библиотека | Курсы | Графикон

Hosted by Graphics & Media Lab
http://graphics.cs.msu.su
lab_logo
mailto: Laboratory