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 |
Define operators used in perl?
Does Perl have reference type?
What is Perl?
How to start perl in interactive mode?
Enlist the advantages of using c over perl?
How to access parameters passed to a subroutine in perl?
How to close a file in perl?
What is the use of -w, -t and strict in Perl?
What is q (single q) operator in perl?
What are the logical operators used for small scale operations? Explain them briefly.
What is perl push array function?
Remove the duplicate data from @array=(“perl”,”php”,”perl”,”asp”)