Help for this page

Select Code to Download


  1. or download this
    our $foo = "foo";
    {
    ...
        }
    }
    quz();  # prints "$foo = foo"
    
  2. or download this
    our $foo = "foo";
    {
    ...
        $foo = "foo";
    }
    quz();  # prints "$foo = foo"
    
  3. or download this
    #!/usr/bin/env perl
    use warnings;
    ...
    Subroutine main::bar redefined at local_ex.pl line 15.
    orig foo
    local bar
    
  4. or download this
    our $bar = "BBB";
    sub foo { print "orig foo (bar=$bar)\n" }
    ...
        baz();  # first call to baz
        quz();  # second call to quz (OOPS, $bar is still undef!)
    }