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 |
Why do we use "use strict" in perl?
What does Perl do if you try to exploit the execve(2) race involving setuid scripts?
what are prefix dereferencer and list them out?
what are the strategies followed for multiple form interaction in cgi programs?
Why Perl aliases are considered to be faster than references?
What can be done for efficient parameter passing in perl?
How would you ensure the re-use and maximum readability of your perl code?
How to find the length of an array in perl?
What are stdin, stdout and stderr?
I have one question regarding to eval function. I know eval function is use for error checking but I am not able to understand below line. eval \'exec perl -S $0 ${1+\"$@\"}\' if 0; $0 for script name $@ set if error occur
what r the future opportunities in PERL/LINUX after 3 years ??
What happens when you return a reference to a private variable?