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 |
What does read () command do?
Who created perl?
You want to empty an array. How would you do that?
What are the steps involved in configuring a server using cgi programming?
What does last statement do in perl?
Define say() function in perl?
Why to use perl scripting?
what is the difference between java and cgi?
What are stdin, stdout and stderr?
Which statement has an initialization, condition check and increment expressions in its body? Write a syntax to use that statement.
What is the use of -n and -p options?
What is the purpose of _package_ literal?