skip to main | skip to sidebar

Perl - Tidings

Wednesday, September 14, 2011

Difference between 'my' and 'local' variable scope declarations

Both of them are used to declare local variables. The variables declared with 'my' can live only within the block and cannot gets its visibility inherited functions called within that block, but one defined as 'local' can live within the block and have its visibility in the functions called within that block.


Posted by Sakthi at 9:11 PM
Labels: Perl Interview Questions

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

My Archive

  • ►  2012 (2)
    • ►  May (2)
  • ▼  2011 (13)
    • ▼  September (13)
      • The caller() function and $wantarray
      • Using the caller() Function in Subroutines
      • Implied Arguments in perl
      • what is it meants by '$_'?
      • Difference between 'my' and 'local' variable scope...
      • what is meant by a 'pack' in perl?
      • How to substitute a particular string in a file co...
      • how do you check the return code of system call?
      • What is '->' in Perl?
      • Difference between 'chomp' and 'chop'?
      • Diffrence between 'use' and 'require' function?
      • How do you know the reference of a variable whethe...
      • Meaning of i and g in Oracle 9i & 10g
  • ►  2010 (8)
    • ►  September (1)
    • ►  August (5)
    • ►  March (1)
    • ►  February (1)
  • ►  2009 (24)
    • ►  July (4)
    • ►  March (11)
    • ►  February (9)
  • ►  2008 (2)
    • ►  November (1)
    • ►  May (1)
  • ►  2007 (1)
    • ►  June (1)