Explain the difference between my and local?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

You want to read command-line arguements with perl. How would you do that?

502


Who created perl?

536


What are the steps involved when the cgi program starts running?

514


How can I display all array element in which each element will display on next line in perl ?

488


What is -> symbol in perl?

578






What is Perl?

567


Explain the meaning of perl one-liner?

523


How do I sort a hash by the hash value?

568


What interface used in PERL to connect to database? How do you connect to database in Perl?

540


Explain strftime() function in perl?

547


Show the use of sockets for the server and client side of a conversation?

480


Which operator in perl is used for the concatenation of two strings?

507


You want to connect to sql server through perl. How would you do that?

550


Differences between die and exit.

627


What does 'do' statement do in perl?

512