Google News
logo
Perl - Quiz(MCQ)
Which of the following is true about lexical scoping?
A)
Lexical scoping is done with my operator.
B)
The my operator confines a variable to a particular region of code in which it can be used and accessed. Outside that region, this variable cannot be used or accessed.
C)
A lexical scope is usually a block of code with a set of braces around it, such as those defining the body of the subroutine or those marking the code blocks of if, while, for, foreach, and eval statements.
D)
All of the above.

Correct Answer :   All of the above.

Advertisement