my, local and global variable : my « Subroutine « Perl






my, local and global variable

   

$value1 = 1;

my $value2 = 2;

local $value3 = 3;

print join(", ", keys %::);

   
    
    
  








Related examples in the same category

1.Using my
2.Using my if statement
3.Using my to declare the local variable in a subroutine
4.my ($program, $exitCode) = @_; creates two local variables, $program and $exitCode, from @_.
5.my variable
6.my variable is initialized each time
7.My value scope
8.Define local variable in subroutine by using my
9.The scope of my variables
10.Use my to declare local variable