Live coverage of Fall Internet World '99! logo

internet.com
Join the free
WDVL newsletter!

home

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

Up to => Home / Authoring / Scripting / Tutorial

Instantly look up a "techie" word using Webopedia!!


internet.com
e-commerce
WebDeveloper Network


Live coverage of Fall Internet World '99!

Copyright 1999 internet.com Corporation. Legal Notices. Privacy Policy.

www.internet.com