QUOTE(girasquid @ 21 Nov, 2007 - 11:12 AM)

The ~ operator is being used with qq to provide the same functionality as double quotes(variable interpolation), but allow me to write all of what I want to print at once on multiple lines, without multiple print statements. It's to cut down on extra typing.
The -> operator is for calling methods on the CGI object that was created and stored into either $q in my sample code, or $cgi in fahlyn's code.
the "~" character is not an operator, it is an arbitrary delimiter that lets the qq operator know where the string begins and ends. I recommend you use {} with qq and q (and other quote and quote-like operators):
print qq{this will be printed};
perl counts in/out paired brackets when used with quoting operators, but it does not with single character delimiters like "~".
You can also use double/single-quotes to print multiple lines. All qq does is add variable interpolation and allows you to use double-quotes without escaping them.
The -> is an operator, commonly called the arrow operator for obvious reasons. It is used for dereferencing references. In the case of:
$q->Vars
$q is an object, which is the same as a reference in perl. Vars is a method (a function) of the $q object. So the arrow operator must be used to tell perl to call the Var function of the $q object (a CGI object). It is also used to dereference other things:
$v = [qw(foo bar baz)];
print $v->[0];# prints "foo";
$v is a reference to an array. You (rustix) will learn about references as your perl education continues.
This post has been edited by KevinADC: 21 Nov, 2007 - 09:06 PM