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 |
Write syntax to add two arrays together in perl?
What $! In perl?
You want to concatenate strings with perl. How would you do that?
Write the program to process a list of numbers.
Why does Perl not have overloaded functions?
How interpreter is used in perl?
What does init 5 and init 0 do?
What happens when you return a reference to a private variable?
“Perl regular expressions match the longest string possible”. What is the name of this match?
Write syntax to use grep function?
What is the main function of cookie server?
What are the characteristics of a project that is well suited to Perl?