Explain the difference between my and local?
Answers were Sorted based on User's Feedback
Answer / mahendra ratnakar
The variables declared with "my" can live only within the
block it was defined and cannot get its visibility
inherited functions called within that block, but one
defined with "local" can live within the block and have its
visibility in the functions called within that block.
| Is This Answer Correct ? | 12 Yes | 4 No |
Answer / sourisengupta
You can consider "my" as local and "local" as global
variable like C,C++.
The scope of "my" lies between the block only but if we
declare one varable global then we can asccess that from
the outside of the block also.
| Is This Answer Correct ? | 2 Yes | 7 No |
Explain perl.
How to close a directory in perl?
What is cpan ? What are the modules coming under this?
What are different data types that perl supports. Elaborate on them.
Explain the difference between "my" and "local" variable scope declarations. ?
Mention what is cpan?
How will you open a file in read-only mode in perl?
What does `$result = f() .. g()' really return?
You want to read command-line arguements with perl. How would you do that?
What does init 5 and init 0 do?
What is q (single q) operator in perl?
How to convert arrays into a string in perl?