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 an interpolation in perl?
how to extract pin_code,phone_number,year from text file using regular expressions in perl
how to search a unique pattern in a file by using perl hash map function ??? plz answer me
How to add elements in a hash in perl?
Explain 'grep' function.
Explain lists and ivalue?
What are the advantages of programming in perl?
Write an expression or perl script to identify the entered ip address is valid or not?
Explain a tell function in perl?
my @array=('data1','data2'); my @array1=('data1','data2'); my ($i,$k); $i=7; $k=7; while($i){ $array [++$#array] = 'ree'; $i--; print "@array"; } while($k){ push(@array1,'ree'); $k--; print "@array1"; } Are these two while loop are doing the same functionality ? What may be the difference?
Write a script to reverse a string without using Perl's built in function
Elaborate on perl bite-wise operators.