introduction to web programming 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";

Previous | Next | Table of Contents