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 is the use of "stderr()"?
How can you replace the characters from a string and save the number of replacements?
Explain about the applications of perl?
How to access parameters passed to a subroutine in perl?
Explain the meaning of closure in perl.
What is the difference between $array[1] and @array[1]?
How many data types are there in perl?
What is an interpolation in perl?
What are arrays in perl?
What are the different string manipulation operators in perl?
What are the various file operations in perl. Explain with example.
how to find a substring in a string without using substr built in functions, and print the substring found