in reply to Prefix binary operators
Operators can be prefix, postfix, or infix. A binary operator is always infix (in perl):
$foo + $bar
In the above example, the plus sign, in this context, is a binary operator and it's "infix" because it's between the two variables that it operates. Unary operators, on the other hand, are always prefix (before the variable), with the exception of the post increment and post decrement operators:
++$x; # prefix $x++; # postfix
The author of your text book probably was referring to Perl's list operators. These are prefix and can take any number of arguments. These are operators like print and sort:
print $x, $b, $c; sort $a, $b, $c;
If there are any binary operators that are prefix in Perl, I confess that I don't know them offhand.
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|