You can create privately scoped variables in Perl (called lexical variables) that won't affect outside variables with the same name by using the following operator:
Select one:
a. my operator - my $firstName;
b. priv operator - priv $firstName;
c. private string operator - private string $firstName;
d. private operator - private $firstName;
Answer Option A
Reason: Option A is correct because in Perl a private variable "my" keyword before the variable name. These lexical variables are created in a particular block and the scope of the variable is within this block only. Therefore the given option A,
my operator - my $firstname
Therefore from the given options only Option A is correct and all the options are wrong.
If you liked the solution then give a thumbs up ? it will be really appreciated ?
Get Answers For Free
Most questions answered within 1 hours.