Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In each case, the operator alters the existing value of the variable in some way rather than overwriting the value with the result of some new expression. Another common assignment operator is made with the string concatenate operator ( . ); this gives us an append operator ( .= ): $str = $str . " "; # append a space to $str $str .= " "; # same thing with assignment operator Nearly all binary operators are valid this way. For example, a raise to the power of operator is written as **= . So, $fred **= 3 means "raise the number in $fred to the third power, placing the result back in $fred ". Output with print It's generally a good idea to have your program produce some output; otherwise, some- one may think it didn't do anything. The print() operator makes this possible. It takes a scalar argument and puts it out without any embellishment onto standard output. Unless you've done something odd, this will be your terminal display: print "hello world\n"; # say hello world, followed by a newline print "The answer is "; print 6 * 7; print ".\n";