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 |
How do I do fill_in_the_blank for each file in a directory?
What is warn function in perl?
Which has highest precedence in between list and terms? Explain?
Explain the default scope of variables in perl?
Why we use "use lib $path"?
When would you not use Perl for a project?
sort a word "system" in perl/shell without using built in functions output should be emssty
how to search a unique pattern in a file by using perl hash map function ??? plz answer me
Explain the meaning of closure in perl.
What does Perl do if you try to exploit the execve(2) race involving setuid scripts?
Write an expression or perl script to identify the entered ip address is valid or not?
What is automatic error handling in perl?