Comment on the scope of variables in perl.



Comment on the scope of variables in perl...

Answer / Nizam Miyan

In Perl, variables have lexical or dynamic scopes. Lexically-scoped variables are declared using my and last only within the block they were defined. Dynamically-scoped variables, also known as package variables, can be accessed throughout the program unless redefined locally.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More CGI Perl Interview Questions

How to find out the version of PERL being installed on your LINUX machine.

4 Answers   Mind Tree,


write a perl script to find whether a given line of text is starting and ending with same word or not ???

2 Answers   CSS,


What is stdin in perl?

1 Answers  


How to start perl in interactive mode?

1 Answers  


What is the difference between use and require in perl programming?

1 Answers  


We all know private variables exist in perl. But do private METHODS exist in perl ? Eg ?

1 Answers   AppLabs,


List all the features of perl programming?

1 Answers  


Explain the different types of data perl can handle.

1 Answers  


write a script to generate n prime no.s?

2 Answers   Persistent,


What is the use of now constructor in perl?

1 Answers  


In CPAN module, name an instance you use.

1 Answers  


Explain goto expr?

1 Answers  


Categories