Loginskip to content

October 31st, 2006

Semantical errors are a way of saying that

Semantical errors are a way of saying that when all else succeeds, you can still be wrong. The program compiles; it runs without any kind of run-time exception; it just doesn’t do what you intended. This is why you need system testing (see Chapter 6). (If you’re relatively new to Perl, this chapter might raise the hairs on the back of your neck a little. Feel free to return to it after you’ve gotten more comfortable with the language.) Here’s a tour of some examples of this obnoxious species of bug. 10.1 A Bit Illogical Perl has several ways of saying and and or: Table 10-1. And, Or, and Xor Operators in Perl Operation AND OR XOR bitwise (non-short-circuiting) & | ^ logical (high precedence) && || logical (low precedence) and or xor (There is no high-precedence logical XOR operator.) The consequences of picking an operator from the wrong row are usually annoying mistakes like open (FH, $file) | die “Error opening $file: $!n”; which dies whether or not the open succeeds, because the | operator is strictly a bitwise arithmetic or string operator, which evaluates both of its operands so that it can return the result of ORing their bits together. In this case, you want ||, which is a logical operator that evaluates its left-hand side and returns it if true; otherwise it evaluates and returns its right- hand side.
Note: If you are looking for top 10 and very good webhost to host and run your jsp application check Actions jsp hosting services

Comments are closed.